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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2267993002: Expose if we are using swiftshader via WebGraphicsContext3DProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: softwarerendering: addmorecomment 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/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index fb9d15055f47824ddf74d15eba03ed5fbcce659a..8a9cb40d3039de88b719622d9ab30eeb170686ea 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -154,6 +154,7 @@ DrawingBuffer::DrawingBuffer(
, m_discardFramebufferSupported(discardFramebufferSupported)
, m_wantAlphaChannel(wantAlphaChannel)
, m_premultipliedAlpha(premultipliedAlpha)
+ , m_softwareRendering(m_contextProvider->isSoftwareRendering())
, m_wantDepth(wantDepth)
, m_wantStencil(wantStencil)
{
@@ -276,6 +277,12 @@ bool DrawingBuffer::PrepareTextureMailbox(cc::TextureMailbox* outMailbox,
if (!m_contentsChanged)
return false;
+ // If the context is lost, we don't know if we should be producing GPU or
+ // software frames, until we get a new context, since the compositor will
+ // be trying to get a new context and may change modes.
+ if (m_gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR)
+ return false;
+
TRACE_EVENT0("blink,rail", "DrawingBuffer::prepareMailbox");
if (m_newMailboxCallback)
@@ -285,7 +292,7 @@ bool DrawingBuffer::PrepareTextureMailbox(cc::TextureMailbox* outMailbox,
if (m_antiAliasingMode != None)
commit();
- if (useSharedMemory) {
+ if (m_softwareRendering) {
std::unique_ptr<cc::SharedBitmap> bitmap = createOrRecycleBitmap();
if (!bitmap)
return false;

Powered by Google App Engine
This is Rietveld 408576698