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

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

Issue 2535173002: Prevent implicit framebuffer clear from clobbering alpha in emulated RGB (Closed)
Patch Set: address comments Created 4 years 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/modules/webgl/WebGLRenderingContextBase.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
index a7b105741259c5e6c2394d39e2cb4c2884ff18e0..c8551e69827a7d782d96d0e00a9ad6ed416e8511 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -110,14 +110,16 @@ class WebGLRenderingContextErrorMessageCallback;
// This class uses the color mask to prevent drawing to the alpha channel, if
// the DrawingBuffer requires RGB emulation.
class ScopedRGBEmulationColorMask {
+ STACK_ALLOCATED();
+
public:
- ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interface*,
+ ScopedRGBEmulationColorMask(WebGLRenderingContextBase*,
GLboolean* colorMask,
DrawingBuffer*);
~ScopedRGBEmulationColorMask();
private:
- gpu::gles2::GLES2Interface* m_contextGL;
+ Member<WebGLRenderingContextBase> m_context;
GLboolean m_colorMask[4];
const bool m_requiresEmulation;
};
@@ -1533,6 +1535,17 @@ class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
static WebGLRenderingContextBase* oldestContext();
static WebGLRenderingContextBase* oldestEvictedContext();
+ friend class ScopedRGBEmulationColorMask;
+ std::list<ScopedRGBEmulationColorMask*> activeScopedRGBEmulationColorMasks;
+ void pushActiveScopedRGBEmulationColorMask(ScopedRGBEmulationColorMask* val) {
+ activeScopedRGBEmulationColorMasks.push_back(val);
+ }
+ ScopedRGBEmulationColorMask* popActiveScopedRGBEmulationColorMask() {
Ken Russell (switch to Gerrit) 2016/12/01 23:45:30 It occurs to me that since the WebGLRenderingConte
Kai Ninomiya 2016/12/02 00:05:27 Great point, thanks. I was thinking of trying to s
+ auto removed = activeScopedRGBEmulationColorMasks.back();
+ activeScopedRGBEmulationColorMasks.pop_back();
+ return removed;
+ }
+
ImageBitmap* transferToImageBitmapBase(ScriptState*);
// Helper functions for tex(Sub)Image2D && texSubImage3D

Powered by Google App Engine
This is Rietveld 408576698