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

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

Issue 2261623002: Make DrawingBuffer and Canvas2DLayerBridge be cc::TextureLayerClients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webmailbox: fix-passrefptr Created 4 years, 4 months 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/ImageBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
index 53f34f2648dd984097a3c7e1c1baab1f54dd2c32..064e73b8981d5e8ab19220141ad61280066521da 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
@@ -33,6 +33,8 @@
#include "platform/graphics/ImageBuffer.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/sync_token.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/geometry/IntRect.h"
@@ -49,7 +51,6 @@
#include "platform/image-encoders/PNGImageEncoder.h"
#include "platform/image-encoders/WEBPImageEncoder.h"
#include "public/platform/Platform.h"
-#include "public/platform/WebExternalTextureMailbox.h"
#include "public/platform/WebGraphicsContext3DProvider.h"
#include "skia/ext/texture_handle.h"
#include "third_party/skia/include/core/SkPicture.h"
@@ -226,20 +227,20 @@ bool ImageBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl, GLuint t
return false;
gpu::gles2::GLES2Interface* sharedGL = provider->contextGL();
- std::unique_ptr<WebExternalTextureMailbox> mailbox = wrapUnique(new WebExternalTextureMailbox);
- mailbox->textureSize = WebSize(textureImage->width(), textureImage->height());
+ gpu::Mailbox mailbox;
+ IntSize textureSize(textureImage->width(), textureImage->height());
// Contexts may be in a different share group. We must transfer the texture through a mailbox first
- sharedGL->GenMailboxCHROMIUM(mailbox->name);
- sharedGL->ProduceTextureDirectCHROMIUM(textureInfo->fID, textureInfo->fTarget, mailbox->name);
+ sharedGL->GenMailboxCHROMIUM(mailbox.name);
+ sharedGL->ProduceTextureDirectCHROMIUM(textureInfo->fID, textureInfo->fTarget, mailbox.name);
const GLuint64 sharedFenceSync = sharedGL->InsertFenceSyncCHROMIUM();
sharedGL->Flush();
- sharedGL->GenSyncTokenCHROMIUM(sharedFenceSync, mailbox->syncToken);
- mailbox->validSyncToken = true;
- gl->WaitSyncTokenCHROMIUM(mailbox->syncToken);
+ gpu::SyncToken produceSyncToken;
+ sharedGL->GenSyncTokenCHROMIUM(sharedFenceSync, produceSyncToken.GetData());
+ gl->WaitSyncTokenCHROMIUM(produceSyncToken.GetConstData());
- GLuint sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(textureInfo->fTarget, mailbox->name);
+ GLuint sourceTexture = gl->CreateAndConsumeTextureCHROMIUM(textureInfo->fTarget, mailbox.name);
// The canvas is stored in a premultiplied format, so unpremultiply if necessary.
// The canvas is stored in an inverted position, so the flip semantics are reversed.
@@ -251,12 +252,12 @@ bool ImageBuffer::copyToPlatformTexture(gpu::gles2::GLES2Interface* gl, GLuint t
gl->Flush();
- GLbyte syncToken[24];
- gl->GenSyncTokenCHROMIUM(contextFenceSync, syncToken);
- sharedGL->WaitSyncTokenCHROMIUM(syncToken);
+ gpu::SyncToken copySyncToken;
+ gl->GenSyncTokenCHROMIUM(contextFenceSync, copySyncToken.GetData());
+ sharedGL->WaitSyncTokenCHROMIUM(copySyncToken.GetConstData());
// This disassociates the texture from the mailbox to avoid leaking the
// mapping between the two.
- sharedGL->ProduceTextureDirectCHROMIUM(0, textureInfo->fTarget, mailbox->name);
+ sharedGL->ProduceTextureDirectCHROMIUM(0, textureInfo->fTarget, mailbox.name);
// Undo grContext texture binding changes introduced in this function
provider->grContext()->resetContext(kTextureBinding_GrGLBackendState);
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/DEPS ('k') | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698