Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Unified Diff: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp

Issue 2455983005: Refactor AcceleratedStaticBitmapImage (Closed)
Patch Set: fix crash Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
index efb3d283d6114cdc0670bbf4a9ff828e2b0299f4..675463c265c5cbe3657ce53716f2cbaf45039768 100644
--- a/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
+++ b/third_party/WebKit/Source/platform/graphics/OffscreenCanvasFrameDispatcherImpl.cpp
@@ -136,8 +136,8 @@ void OffscreenCanvasFrameDispatcherImpl::
cc::TransferableResource& resource,
RefPtr<StaticBitmapImage> image) {
image->ensureMailbox();
- resource.mailbox_holder = gpu::MailboxHolder(
- image->getMailbox(), image->getSyncToken(), GL_TEXTURE_2D);
+ resource.mailbox_holder =
+ gpu::MailboxHolder(image->mailbox(), image->syncToken(), GL_TEXTURE_2D);
resource.read_lock_fences_enabled = false;
resource.is_software = false;
@@ -321,6 +321,9 @@ void OffscreenCanvasFrameDispatcherImpl::DidReceiveCompositorFrameAck() {
void OffscreenCanvasFrameDispatcherImpl::ReclaimResources(
const cc::ReturnedResourceArray& resources) {
for (const auto& resource : resources) {
+ RefPtr<StaticBitmapImage> image = m_cachedImages.get(resource.id);
+ if (image)
+ image->updateSyncToken(resource.sync_token);
m_cachedImages.remove(resource.id);
m_sharedBitmaps.remove(resource.id);
m_cachedTextureIds.remove(resource.id);

Powered by Google App Engine
This is Rietveld 408576698