Quellcode-Bibliothek BlobSurfaceProvider.cpp
Sprache: C
/* -*- 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/. */
// Even if the manager is the same, its underlying WebRenderBridgeChild // can change state. Either our namespace differs, and our old key has // already been discarded, or the blob has changed. Either way, we need // to rerecord it. auto newEntry = RecordDrawing(manager, aResources,
ownsKey ? Some(entry.mBlobKey) : Nothing()); if (!newEntry) { if (ownsKey) {
aManager->AddBlobImageKeyForDiscard(entry.mBlobKey);
}
mKeys.RemoveElementAt(i); continue;
}
// We didn't find an entry. Attempt to record the blob with a new key. if (!key) { auto newEntry = RecordDrawing(manager, aResources, Nothing()); if (newEntry) {
key.emplace(newEntry.ref().mBlobKey);
mKeys.AppendElement(std::move(newEntry.ref()));
}
}
if (key) {
aKey = wr::AsImageKey(key.value()); return NS_OK;
}
if (mSVGDocumentWrapper->IsDrawing()) { return Nothing();
}
// This is either our first pass, or we have a stale key requiring us to // re-record the SVG image draw commands. auto* rootManager = aManager->GetRenderRootStateManager(); auto* wrBridge = aManager->WrBridge();
IntSize viewportSize = size; if (auto cssViewportSize = svgContext.GetViewportSize()) { // XXX losing unit
viewportSize.SizeTo(cssViewportSize->width, cssViewportSize->height);
}
{ // Get (& sanity-check) the helper-doc's presShell
RefPtr<PresShell> presShell = mSVGDocumentWrapper->GetPresShell();
MOZ_ASSERT(presShell, "GetPresShell returned null for an SVG image?");
for (auto& entry : externalSurfaces) { // While we don't use the image key with the surface, because the blob image // renderer doesn't have easy access to the resource set, we still want to // ensure one is generated. That will ensure the surface remains alive until // at least the last epoch which the blob image could be used in.
wr::ImageKey key = {};
DebugOnly<nsresult> rv = SharedSurfacesChild::Share(
entry.mSurface, rootManager, aResources, key);
MOZ_ASSERT(rv.value != NS_ERROR_NOT_IMPLEMENTED);
}
¤ 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.0.14Bemerkung:
(vorverarbeitet)
¤
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.