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

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

Issue 1856933002: WebGL GL_RGB emulation to support IOSurfaces on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clean up. Created 4 years, 8 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.h
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
index 4d1e7bed0b4aca88899abb49ee5e8d63e603672b..9e95a17e84e2dda59096f6f5c8e752ae31f8fc72 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h
@@ -143,6 +143,14 @@ public:
}
}
+ // The DrawingBuffer needs to track the currently bound renderbuffer so it
+ // restore the binding when needed.
+ void setRenderbufferBinding(GLuint renderbuffer)
+ {
+ m_renderbufferBinding = renderbuffer;
+ }
+
+
// Track the currently active texture unit. Texture unit 0 is used as host for a scratch
// texture.
void setActiveTextureUnit(GLint textureUnit) { m_activeTextureUnit = textureUnit; }
@@ -159,6 +167,12 @@ public:
void setIsHidden(bool);
void setFilterQuality(SkFilterQuality);
+ // Indicates that the currently bound framebuffer has internalformat
+ // GL_RGBA, but is emulating GL_RGB. This happens to the backbuffer when the
+ // client requests alpha:False, but GL_RGB textures are unusable because of
+ // driver bugs.
+ bool requiresRGBEmulation();
+
WebLayer* platformLayer();
WebGraphicsContext3D* context();
@@ -202,12 +216,18 @@ private:
DISALLOW_NEW();
GLenum target;
GLenum internalColorFormat;
+
+ // The internal color format used when allocating storage for the
+ // texture. This may be different from internalColorFormat if RGB
+ // emulation is required.
+ GLenum creationInternalColorFormat;
GLenum colorFormat;
GLenum internalRenderbufferFormat;
TextureParameters()
: target(0)
, internalColorFormat(0)
+ , creationInternalColorFormat(0)
, colorFormat(0)
, internalRenderbufferFormat(0)
{
@@ -293,6 +313,10 @@ private:
// Allocate buffer storage to be sent to compositor using either texImage2D or CHROMIUM_image based on available support.
void deleteChromiumImageForTexture(TextureInfo*);
+ // If RGB emulation is required, then the CHROMIUM image must be immediately
+ // cleared after it is bound to a texture.
+ void clearChromiumImageIfNecessary(const TextureInfo&);
+
// Tries to create a CHROMIUM_image backed texture if
// RuntimeEnabledFeatures::webGLImageChromiumEnabled() is true. On failure,
// or if the flag is false, creates a default texture.
@@ -310,6 +334,7 @@ private:
GLuint m_texture2DBinding;
GLuint m_drawFramebufferBinding;
GLuint m_readFramebufferBinding;
+ GLuint m_renderbufferBinding;
GLenum m_activeTextureUnit;
OwnPtr<WebGraphicsContext3DProvider> m_contextProvider;
@@ -337,6 +362,8 @@ private:
// For multisampling.
GLuint m_multisampleFBO;
+ GLuint m_multisampleIntermediateFBO;
+ GLuint m_multisampleIntermediateRenderbuffer;
GLuint m_multisampleColorBuffer;
// True if our contents have been modified since the last presentation of this buffer.

Powered by Google App Engine
This is Rietveld 408576698