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

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

Issue 1808403002: Move simple methods [F-S] from WebGraphicsContext3D to GLES2Interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindFoo
Patch Set: simples-fplus: tests Created 4 years, 9 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/Canvas2DLayerBridge.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 19d3be5113c8cc0bcd30e5d7f020e8242380facb..2c842d2baea88e1e53e466058420db10bfaa2d3d 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -219,12 +219,12 @@ bool Canvas2DLayerBridge::prepareIOSurfaceMailboxFromImage(SkImage* image, WebEx
gpu::gles2::GLES2Interface* gl = contextGL();
GLuint imageTexture = skia::GrBackendObjectToGrGLTextureInfo(image->getTextureHandle(true))->fID;
- context()->copySubTextureCHROMIUM(imageTexture, imageInfo.m_textureId, 0, 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE);
+ gl->CopySubTextureCHROMIUM(imageTexture, imageInfo.m_textureId, 0, 0, 0, 0, m_size.width(), m_size.height(), GL_FALSE, GL_FALSE, GL_FALSE);
MailboxInfo& info = m_mailboxes.first();
info.m_mailbox.textureTarget = GC3D_TEXTURE_RECTANGLE_ARB;
- context()->genMailboxCHROMIUM(info.m_mailbox.name);
- context()->produceTextureDirectCHROMIUM(imageInfo.m_textureId, info.m_mailbox.textureTarget, info.m_mailbox.name);
+ gl->GenMailboxCHROMIUM(info.m_mailbox.name);
+ gl->ProduceTextureDirectCHROMIUM(imageInfo.m_textureId, info.m_mailbox.textureTarget, info.m_mailbox.name);
info.m_mailbox.allowOverlay = true;
const WGC3Duint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
@@ -357,10 +357,10 @@ bool Canvas2DLayerBridge::prepareMailboxFromImage(PassRefPtr<SkImage> image, Web
ASSERT(mailboxInfo.m_image->getTexture()->getCustomData()->size() == sizeof(mailboxInfo.m_mailbox.name));
memcpy(&mailboxInfo.m_mailbox.name[0], mailboxInfo.m_image->getTexture()->getCustomData()->data(), sizeof(mailboxInfo.m_mailbox.name));
} else {
- context()->genMailboxCHROMIUM(mailboxInfo.m_mailbox.name);
+ gl->GenMailboxCHROMIUM(mailboxInfo.m_mailbox.name);
RefPtr<SkData> mailboxNameData = adoptRef(SkData::NewWithCopy(&mailboxInfo.m_mailbox.name[0], sizeof(mailboxInfo.m_mailbox.name)));
mailboxInfo.m_image->getTexture()->setCustomData(mailboxNameData.get());
- webContext->produceTextureCHROMIUM(GL_TEXTURE_2D, mailboxInfo.m_mailbox.name);
+ gl->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailboxInfo.m_mailbox.name);
}
if (isHidden()) {
@@ -371,7 +371,7 @@ bool Canvas2DLayerBridge::prepareMailboxFromImage(PassRefPtr<SkImage> image, Web
// FIXME: We'd rather insert a syncpoint than perform a flush here,
// but currently the canvas will flicker if we don't flush here.
const GLuint64 fenceSync = gl->InsertFenceSyncCHROMIUM();
- webContext->flush();
+ gl->Flush();
mailboxInfo.m_mailbox.validSyncToken = webContext->genSyncTokenCHROMIUM(fenceSync, mailboxInfo.m_mailbox.syncToken);
}
gl->BindTexture(GL_TEXTURE_2D, 0);
@@ -707,9 +707,9 @@ void Canvas2DLayerBridge::flushGpu()
{
TRACE_EVENT0("cc", "Canvas2DLayerBridge::flushGpu");
flush();
- WebGraphicsContext3D* webContext = context();
- if (isAccelerated() && webContext)
- webContext->flush();
+ gpu::gles2::GLES2Interface* gl = contextGL();
+ if (isAccelerated() && gl)
+ gl->Flush();
}

Powered by Google App Engine
This is Rietveld 408576698