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

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

Issue 1508903002: Use GrGLTextureInfo for Skia texture handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ignore_gl_target
Patch Set: Set target type in from mailbox in skcanvas_video_renderer Created 4 years, 10 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
« no previous file with comments | « skia/ext/texture_handle.h ('k') | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 49a2d787ddd0905f4d6ca69cbd9aded38fa7b9a5..8a7d2e26bd42ffcbaaabc195f94c4ba99d332d79 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -39,10 +39,12 @@
#include "public/platform/WebGraphicsContext3DProvider.h"
#include "public/platform/WebScheduler.h"
#include "public/platform/WebTraceLocation.h"
+#include "skia/ext/texture_handle.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/core/SkSurface.h"
#include "third_party/skia/include/gpu/GrContext.h"
+#include "third_party/skia/include/gpu/gl/GrGLTypes.h"
#include "wtf/RefCountedLeakCounter.h"
namespace {
@@ -636,16 +638,15 @@ bool Canvas2DLayerBridge::prepareMailbox(WebExternalTextureMailbox* outMailbox,
if (RuntimeEnabledFeatures::forceDisable2dCanvasCopyOnWriteEnabled())
m_surface->notifyContentWillChange(SkSurface::kRetain_ContentChangeMode);
- // Need to flush skia's internal queue because texture is about to be accessed directly
- grContext->flush();
-
// Because of texture sharing with the compositor, we must invalidate
// the state cached in skia so that the deferred copy on write
// in SkSurface_Gpu does not make any false assumptions.
mailboxInfo.m_image->getTexture()->textureParamsModified();
mailboxInfo.m_mailbox.textureTarget = GL_TEXTURE_2D;
- webContext->bindTexture(GL_TEXTURE_2D, mailboxInfo.m_image->getTexture()->getTextureHandle());
+ // Passing true because we need to flush skia's internal queue since texture is about to be accessed directly
+ GLuint textureID = skia::GrBackendObjectToGrGLTextureInfo(mailboxInfo.m_image->getTextureHandle(true))->fID;
+ webContext->bindTexture(GL_TEXTURE_2D, textureID);
webContext->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
webContext->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
webContext->texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
« no previous file with comments | « skia/ext/texture_handle.h ('k') | third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridgeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698