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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp

Issue 2509193002: Correct the OffscreenCanvas.getContext API (Closed)
Patch Set: support webgl2 Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webgl/WebGL2RenderingContextBase.h" 5 #include "modules/webgl/WebGL2RenderingContextBase.h"
6 6
7 #include "bindings/modules/v8/WebGLAny.h" 7 #include "bindings/modules/v8/WebGLAny.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/frame/ImageBitmap.h" 9 #include "core/frame/ImageBitmap.h"
10 #include "core/html/HTMLCanvasElement.h" 10 #include "core/html/HTMLCanvasElement.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 m_boundUniformBuffer(this, nullptr), 240 m_boundUniformBuffer(this, nullptr),
241 m_currentBooleanOcclusionQuery(this, nullptr), 241 m_currentBooleanOcclusionQuery(this, nullptr),
242 m_currentTransformFeedbackPrimitivesWrittenQuery(this, nullptr), 242 m_currentTransformFeedbackPrimitivesWrittenQuery(this, nullptr),
243 m_currentElapsedQuery(this, nullptr) { 243 m_currentElapsedQuery(this, nullptr) {
244 m_supportedInternalFormatsStorage.insert( 244 m_supportedInternalFormatsStorage.insert(
245 kSupportedInternalFormatsStorage, 245 kSupportedInternalFormatsStorage,
246 kSupportedInternalFormatsStorage + 246 kSupportedInternalFormatsStorage +
247 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage)); 247 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage));
248 } 248 }
249 249
250 WebGL2RenderingContextBase::WebGL2RenderingContextBase(
251 OffscreenCanvas* passedOffscreenCanvas,
252 std::unique_ptr<WebGraphicsContext3DProvider> contextProvider,
253 const CanvasContextCreationAttributes& requestedAttributes)
254 : WebGLRenderingContextBase(passedOffscreenCanvas,
255 std::move(contextProvider),
256 requestedAttributes,
257 2),
258 m_readFramebufferBinding(this, nullptr),
259 m_transformFeedbackBinding(this, nullptr),
260 m_boundCopyReadBuffer(this, nullptr),
261 m_boundCopyWriteBuffer(this, nullptr),
262 m_boundPixelPackBuffer(this, nullptr),
263 m_boundPixelUnpackBuffer(this, nullptr),
264 m_boundTransformFeedbackBuffer(this, nullptr),
265 m_boundUniformBuffer(this, nullptr),
266 m_currentBooleanOcclusionQuery(this, nullptr),
267 m_currentTransformFeedbackPrimitivesWrittenQuery(this, nullptr),
268 m_currentElapsedQuery(this, nullptr) {
269 m_supportedInternalFormatsStorage.insert(
270 kSupportedInternalFormatsStorage,
271 kSupportedInternalFormatsStorage +
272 WTF_ARRAY_LENGTH(kSupportedInternalFormatsStorage));
273 }
274
250 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() { 275 WebGL2RenderingContextBase::~WebGL2RenderingContextBase() {
251 m_readFramebufferBinding = nullptr; 276 m_readFramebufferBinding = nullptr;
252 277
253 m_boundCopyReadBuffer = nullptr; 278 m_boundCopyReadBuffer = nullptr;
254 m_boundCopyWriteBuffer = nullptr; 279 m_boundCopyWriteBuffer = nullptr;
255 m_boundPixelPackBuffer = nullptr; 280 m_boundPixelPackBuffer = nullptr;
256 m_boundPixelUnpackBuffer = nullptr; 281 m_boundPixelUnpackBuffer = nullptr;
257 m_boundTransformFeedbackBuffer = nullptr; 282 m_boundTransformFeedbackBuffer = nullptr;
258 m_boundUniformBuffer = nullptr; 283 m_boundUniformBuffer = nullptr;
259 284
(...skipping 4680 matching lines...) Expand 10 before | Expand all | Expand 10 after
4940 4965
4941 void WebGL2RenderingContextBase:: 4966 void WebGL2RenderingContextBase::
4942 DrawingBufferClientRestorePixelUnpackBufferBinding() { 4967 DrawingBufferClientRestorePixelUnpackBufferBinding() {
4943 if (!contextGL()) 4968 if (!contextGL())
4944 return; 4969 return;
4945 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER, 4970 contextGL()->BindBuffer(GL_PIXEL_UNPACK_BUFFER,
4946 objectOrZero(m_boundPixelUnpackBuffer.get())); 4971 objectOrZero(m_boundPixelUnpackBuffer.get()));
4947 } 4972 }
4948 4973
4949 } // namespace blink 4974 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698