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

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

Issue 1790753002: Expose GLES2Interface to blink, and delete isContextLost() from WGC3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wgc3d: deps-for-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 90ef507f7654dec1597a9a80631d9f400df18244..5e7d0d3f45c2f6a54b9b87821eebb1963c0803f4 100644
--- a/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -25,6 +25,7 @@
#include "platform/graphics/Canvas2DLayerBridge.h"
+#include "gpu/command_buffer/client/gles2_interface.h"
#include "platform/Histogram.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/TraceEvent.h"
@@ -178,7 +179,7 @@ bool Canvas2DLayerBridge::shouldAccelerate(AccelerationHint hint) const
else
accelerate = hint == PreferAcceleration || hint == PreferAccelerationAfterVisibilityChange;
- if (accelerate && (!m_contextProvider || m_contextProvider->context3d()->isContextLost()))
+ if (accelerate && (!m_contextProvider || m_contextProvider->contextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR))
accelerate = false;
return accelerate;
}
@@ -727,7 +728,7 @@ bool Canvas2DLayerBridge::checkSurfaceValid()
return true;
if (!m_surface)
return false;
- if (m_contextProvider->context3d()->isContextLost()) {
+ if (m_contextProvider->contextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR) {
m_surface.clear();
for (auto mailboxInfo = m_mailboxes.begin(); mailboxInfo != m_mailboxes.end(); ++mailboxInfo) {
if (mailboxInfo->m_image)
@@ -747,13 +748,13 @@ bool Canvas2DLayerBridge::restoreSurface()
return false;
ASSERT(isAccelerated() && !m_surface);
- WebGraphicsContext3D* sharedContext = 0;
+ gpu::gles2::GLES2Interface* sharedGL = nullptr;
m_layer->clearTexture();
m_contextProvider = adoptPtr(Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
if (m_contextProvider)
- sharedContext = m_contextProvider->context3d();
+ sharedGL = m_contextProvider->contextGL();
- if (sharedContext && !sharedContext->isContextLost()) {
+ if (sharedGL && sharedGL->GetGraphicsResetStatusKHR() == GL_NO_ERROR) {
GrContext* grCtx = m_contextProvider->grContext();
bool surfaceIsAccelerated;
RefPtr<SkSurface> surface(createSkSurface(grCtx, m_size, m_msaaSampleCount, m_opacityMode, &surfaceIsAccelerated));
@@ -819,7 +820,7 @@ bool Canvas2DLayerBridge::prepareMailbox(WebExternalTextureMailbox* outMailbox,
void Canvas2DLayerBridge::mailboxReleased(const WebExternalTextureMailbox& mailbox, bool lostResource)
{
ASSERT(isAccelerated() || isHibernating());
- bool contextLost = !isHibernating() && (!m_surface || m_contextProvider->context3d()->isContextLost());
+ bool contextLost = !isHibernating() && (!m_surface || m_contextProvider->contextGL()->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
ASSERT(m_mailboxes.last().m_parentLayerBridge.get() == this);
// Mailboxes are typically released in FIFO order, so we iterate

Powered by Google App Engine
This is Rietveld 408576698