/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// There is a case that mSize and size of mTexture are different. In this // case, size of sourceSurface is different from mSize. if (sourceSurface && sourceSurface->GetSize() != mSize) {
MOZ_RELEASE_ASSERT(sourceSurface->GetType() == SurfaceType::DATA_ALIGNED);
RefPtr<gfx::SourceSurfaceAlignedRawData> rawData = static_cast<gfx::SourceSurfaceAlignedRawData*>(sourceSurface.get()); auto data = rawData->GetData(); auto stride = rawData->Stride(); auto size = rawData->GetSize(); auto format = rawData->GetFormat();
sourceSurface = gfx::Factory::CreateWrappingDataSourceSurface(
data, stride, Min(size, mSize), format,
[](void* aClosure) {
RefPtr<SourceSurfaceAlignedRawData> surface =
dont_AddRef(static_cast<SourceSurfaceAlignedRawData*>(aClosure));
},
rawData.forget().take());
} return sourceSurface.forget();
}
nsresult D3D11ZeroCopyTextureImage::BuildSurfaceDescriptorBuffer(
SurfaceDescriptorBuffer& aSdBuffer, BuildSdbFlags aFlags, const std::function<MemoryOrShmem(uint32_t)>& aAllocate) {
RefPtr<ID3D11Texture2D> src = GetTexture(); if (!src) {
gfxWarning() << "Cannot readback from shared texture because no texture is " "available."; return NS_ERROR_FAILURE;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.