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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1950053003: Clean up DrawingBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix completeness checks. Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 3a3896991586965d05d4a9cbd037c87b2c0bb136..cae269a60206b517155333453a81746b14a2fea4 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -127,7 +127,7 @@ WebGLRenderingContextBaseMap& forciblyEvictedContexts()
ScopedRGBEmulationColorMask::ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interface* contextGL, GLboolean* colorMask, DrawingBuffer* drawingBuffer)
: m_contextGL(contextGL)
- , m_requiresEmulation(drawingBuffer->requiresRGBEmulation())
+ , m_requiresEmulation(drawingBuffer->requiresAlphaChannelToBePreserved())
{
if (m_requiresEmulation) {
memcpy(m_colorMask, colorMask, 4 * sizeof(GLboolean));
@@ -1164,7 +1164,7 @@ WebGLRenderingContextBase::HowToClear WebGLRenderingContextBase::clearIfComposit
} else {
contextGL()->ClearColor(0, 0, 0, 0);
}
- contextGL()->ColorMask(true, true, true, !drawingBuffer()->requiresRGBEmulation());
+ contextGL()->ColorMask(true, true, true, !drawingBuffer()->requiresAlphaChannelToBePreserved());
GLbitfield clearMask = GL_COLOR_BUFFER_BIT;
if (contextAttributes.get().depth()) {
if (!combinedClear || !m_depthMask || !(mask & GL_DEPTH_BUFFER_BIT))
@@ -1304,8 +1304,7 @@ void WebGLRenderingContextBase::reshape(int width, int height)
// We don't have to mark the canvas as dirty, since the newly created image buffer will also start off
// clear (and this matches what reshape will do).
- bool wantDepthOrStencilBuffer = m_requestedAttributes.depth() || m_requestedAttributes.stencil();
- drawingBuffer()->reset(IntSize(width, height), wantDepthOrStencilBuffer);
+ drawingBuffer()->reset(IntSize(width, height));
restoreStateAfterClear();
contextGL()->BindTexture(GL_TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get()));
@@ -2594,7 +2593,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
case GL_ALIASED_POINT_SIZE_RANGE:
return getWebGLFloatArrayParameter(scriptState, pname);
case GL_ALPHA_BITS:
- if (m_drawingBuffer->requiresRGBEmulation())
+ if (m_drawingBuffer->requiresAlphaChannelToBePreserved())
return WebGLAny(scriptState, 0);
return getIntParameter(scriptState, pname);
case GL_ARRAY_BUFFER_BINDING:
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698