| 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..da55b6d0d15773a62630bc3e73ef878d72bbd9e9 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;
|
|
|
| @@ -153,7 +153,7 @@ void OffscreenCanvasFrameDispatcherImpl::dispatchFrame(
|
| called on SwiftShader. */) {
|
| if (!image)
|
| return;
|
| - if (!verifyImageSize(image->imageForCurrentFrame()))
|
| + if (!verifyImageSize(image->size()))
|
| return;
|
| cc::CompositorFrame frame;
|
| // TODO(crbug.com/652931): update the device_scale_factor
|
| @@ -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);
|
| @@ -328,8 +331,8 @@ void OffscreenCanvasFrameDispatcherImpl::ReclaimResources(
|
| }
|
|
|
| bool OffscreenCanvasFrameDispatcherImpl::verifyImageSize(
|
| - const sk_sp<SkImage>& image) {
|
| - if (image && image->width() == m_width && image->height() == m_height)
|
| + const IntSize imageSize) {
|
| + if (imageSize.width() == m_width && imageSize.height() == m_height)
|
| return true;
|
| return false;
|
| }
|
|
|