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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2535173002: Prevent implicit framebuffer clear from clobbering alpha in emulated RGB (Closed)
Patch Set: remove unnecessary std::list 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 class WebGLShaderPrecisionFormat; 103 class WebGLShaderPrecisionFormat;
104 class WebGLSharedObject; 104 class WebGLSharedObject;
105 class WebGLUniformLocation; 105 class WebGLUniformLocation;
106 class WebGLVertexArrayObjectBase; 106 class WebGLVertexArrayObjectBase;
107 107
108 class WebGLRenderingContextErrorMessageCallback; 108 class WebGLRenderingContextErrorMessageCallback;
109 109
110 // This class uses the color mask to prevent drawing to the alpha channel, if 110 // This class uses the color mask to prevent drawing to the alpha channel, if
111 // the DrawingBuffer requires RGB emulation. 111 // the DrawingBuffer requires RGB emulation.
112 class ScopedRGBEmulationColorMask { 112 class ScopedRGBEmulationColorMask {
113 STACK_ALLOCATED();
114
113 public: 115 public:
114 ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interface*, 116 ScopedRGBEmulationColorMask(WebGLRenderingContextBase*,
115 GLboolean* colorMask, 117 GLboolean* colorMask,
116 DrawingBuffer*); 118 DrawingBuffer*);
117 ~ScopedRGBEmulationColorMask(); 119 ~ScopedRGBEmulationColorMask();
118 120
119 private: 121 private:
120 gpu::gles2::GLES2Interface* m_contextGL; 122 Member<WebGLRenderingContextBase> m_context;
121 GLboolean m_colorMask[4]; 123 GLboolean m_colorMask[4];
122 const bool m_requiresEmulation; 124 const bool m_requiresEmulation;
123 }; 125 };
124 126
125 class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext, 127 class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext,
126 public DrawingBuffer::Client { 128 public DrawingBuffer::Client {
127 WTF_MAKE_NONCOPYABLE(WebGLRenderingContextBase); 129 WTF_MAKE_NONCOPYABLE(WebGLRenderingContextBase);
128 130
129 public: 131 public:
130 ~WebGLRenderingContextBase() override; 132 ~WebGLRenderingContextBase() override;
(...skipping 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 static void addToEvictedList(WebGLRenderingContextBase*); 1528 static void addToEvictedList(WebGLRenderingContextBase*);
1527 static void removeFromEvictedList(WebGLRenderingContextBase*); 1529 static void removeFromEvictedList(WebGLRenderingContextBase*);
1528 static void willDestroyContext(WebGLRenderingContextBase*); 1530 static void willDestroyContext(WebGLRenderingContextBase*);
1529 static void forciblyLoseOldestContext(const String& reason); 1531 static void forciblyLoseOldestContext(const String& reason);
1530 // Return the least recently used context's position in the active context 1532 // Return the least recently used context's position in the active context
1531 // vector. If the vector is empty, return the maximum allowed active context 1533 // vector. If the vector is empty, return the maximum allowed active context
1532 // number. 1534 // number.
1533 static WebGLRenderingContextBase* oldestContext(); 1535 static WebGLRenderingContextBase* oldestContext();
1534 static WebGLRenderingContextBase* oldestEvictedContext(); 1536 static WebGLRenderingContextBase* oldestEvictedContext();
1535 1537
1538 friend class ScopedRGBEmulationColorMask;
1539 unsigned m_activeScopedRGBEmulationColorMasks;
1540
1536 ImageBitmap* transferToImageBitmapBase(ScriptState*); 1541 ImageBitmap* transferToImageBitmapBase(ScriptState*);
1537 1542
1538 // Helper functions for tex(Sub)Image2D && texSubImage3D 1543 // Helper functions for tex(Sub)Image2D && texSubImage3D
1539 void texImageHelperDOMArrayBufferView(TexImageFunctionID, 1544 void texImageHelperDOMArrayBufferView(TexImageFunctionID,
1540 GLenum, 1545 GLenum,
1541 GLint, 1546 GLint,
1542 GLint, 1547 GLint,
1543 GLsizei, 1548 GLsizei,
1544 GLsizei, 1549 GLsizei,
1545 GLsizei, 1550 GLsizei,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 context, 1673 context,
1669 context->is3d(), 1674 context->is3d(),
1670 context.is3d()); 1675 context.is3d());
1671 1676
1672 } // namespace blink 1677 } // namespace blink
1673 1678
1674 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( 1679 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(
1675 blink::WebGLRenderingContextBase::TextureUnitState); 1680 blink::WebGLRenderingContextBase::TextureUnitState);
1676 1681
1677 #endif // WebGLRenderingContextBase_h 1682 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698