/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * 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/. */
if (!mWindowSurface || mWindowSurface->CairoStatus() ||
!(size <= mWindowSurface->GetSize())) {
mWindowSurface = new gfxXlibSurface(mDisplay, mWindow, mVisual, size);
} if (mWindowSurface->CairoStatus()) { return nullptr;
}
if (!mImageSurface || mImageSurface->CairoStatus() ||
!(size <= mImageSurface->GetSize())) {
gfxImageFormat format = SurfaceFormatToImageFormat(mFormat); if (format == gfx::SurfaceFormat::UNKNOWN) {
format = mDepth == 32 ? gfx::SurfaceFormat::A8R8G8B8_UINT32
: gfx::SurfaceFormat::X8R8G8B8_UINT32;
}
mImageSurface = new gfxImageSurface(size, format); if (mImageSurface->CairoStatus()) { return nullptr;
}
}
gfxImageFormat format = mImageSurface->Format(); // Cairo prefers compositing to BGRX instead of BGRA where possible. // Cairo/pixman lacks some fast paths for compositing BGRX onto BGRA, so // just report it as BGRX directly in that case. // Otherwise, for Skia, report it as BGRA to the compositor. The alpha // channel will be discarded when we put the image. if (format == gfx::SurfaceFormat::X8R8G8B8_UINT32) {
gfx::BackendType backend = gfxVars::ContentBackend(); if (!gfx::Factory::DoesBackendSupportDataDrawtarget(backend)) {
backend = gfx::BackendType::SKIA;
} if (backend != gfx::BackendType::CAIRO) {
format = gfx::SurfaceFormat::A8R8G8B8_UINT32;
}
}
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.