Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 // Restore DrawingBuffer if needed | 131 // Restore DrawingBuffer if needed |
| 132 if (!m_readFramebufferBinding && m_drawingBuffer) | 132 if (!m_readFramebufferBinding && m_drawingBuffer) |
| 133 m_drawingBuffer->restoreFramebufferBindings(); | 133 m_drawingBuffer->restoreFramebufferBindings(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 private: | 136 private: |
| 137 DrawingBuffer* m_drawingBuffer; | 137 DrawingBuffer* m_drawingBuffer; |
| 138 Member<WebGLFramebuffer> m_readFramebufferBinding; | 138 Member<WebGLFramebuffer> m_readFramebufferBinding; |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 // This class uses the color mask to prevents drawing to the alpha channel, if | |
|
Ken Russell (switch to Gerrit)
2016/05/03 23:32:27
typo: prevents -> prevent
erikchen
2016/05/04 00:23:11
Done.
| |
| 142 // the DrawingBuffer requires RGB emulation. | |
| 143 class ScopedRGBEmulationColorMask { | |
| 144 public: | |
| 145 ScopedRGBEmulationColorMask(gpu::gles2::GLES2Interface*, GLboolean* colorMas k, DrawingBuffer*); | |
| 146 ~ScopedRGBEmulationColorMask(); | |
| 147 | |
| 148 private: | |
| 149 gpu::gles2::GLES2Interface* m_contextGL; | |
| 150 GLboolean m_colorMask[4]; | |
| 151 const bool m_requiresEmulation; | |
| 152 }; | |
| 153 | |
| 141 class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext { | 154 class MODULES_EXPORT WebGLRenderingContextBase : public CanvasRenderingContext { |
| 142 public: | 155 public: |
| 143 ~WebGLRenderingContextBase() override; | 156 ~WebGLRenderingContextBase() override; |
| 144 | 157 |
| 145 virtual unsigned version() const = 0; | 158 virtual unsigned version() const = 0; |
| 146 virtual String contextName() const = 0; | 159 virtual String contextName() const = 0; |
| 147 virtual void registerContextExtensions() = 0; | 160 virtual void registerContextExtensions() = 0; |
| 148 | 161 |
| 149 virtual void initializeNewContext(); | 162 virtual void initializeNewContext(); |
| 150 | 163 |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1079 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W ebGraphicsContext3DProvider>, const WebGLContextAttributes&); | 1092 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W ebGraphicsContext3DProvider>, const WebGLContextAttributes&); |
| 1080 }; | 1093 }; |
| 1081 | 1094 |
| 1082 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); | 1095 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); |
| 1083 | 1096 |
| 1084 } // namespace blink | 1097 } // namespace blink |
| 1085 | 1098 |
| 1086 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); | 1099 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); |
| 1087 | 1100 |
| 1088 #endif // WebGLRenderingContextBase_h | 1101 #endif // WebGLRenderingContextBase_h |
| OLD | NEW |