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

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

Issue 2569863005: Move getBufferSubDataAsync to an extension (Closed)
Patch Set: fixup 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 // 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 #ifndef WebGL2RenderingContextBase_h 5 #ifndef WebGL2RenderingContextBase_h
6 #define WebGL2RenderingContextBase_h 6 #define WebGL2RenderingContextBase_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/TraceWrapperMember.h" 8 #include "bindings/core/v8/TraceWrapperMember.h"
10 #include "modules/webgl/WebGLExtension.h" 9 #include "modules/webgl/WebGLExtension.h"
11 #include "modules/webgl/WebGLRenderingContextBase.h" 10 #include "modules/webgl/WebGLRenderingContextBase.h"
12 #include <memory> 11 #include <memory>
13 12
14 namespace blink { 13 namespace blink {
15 14
16 class WebGLTexture; 15 class WebGLTexture;
17 16
18 class WebGLActiveInfo; 17 class WebGLActiveInfo;
19 class WebGLBuffer; 18 class WebGLBuffer;
19 class WebGLGetBufferSubDataAsync;
20 class WebGLGetBufferSubDataAsyncCallback; 20 class WebGLGetBufferSubDataAsyncCallback;
21 class WebGLProgram; 21 class WebGLProgram;
22 class WebGLQuery; 22 class WebGLQuery;
23 class WebGLSampler; 23 class WebGLSampler;
24 class WebGLSync; 24 class WebGLSync;
25 class WebGLTransformFeedback; 25 class WebGLTransformFeedback;
26 class WebGLUniformLocation; 26 class WebGLUniformLocation;
27 class WebGLVertexArrayObject; 27 class WebGLVertexArrayObject;
28 28
29 class WebGL2RenderingContextBase : public WebGLRenderingContextBase { 29 class WebGL2RenderingContextBase : public WebGLRenderingContextBase {
30 public: 30 public:
31 void destroyContext() override; 31 void destroyContext() override;
32 32
33 /* Buffer objects */ 33 /* Buffer objects */
34 void bufferData(GLenum, DOMArrayBufferView*, GLenum, GLuint, GLuint); 34 void bufferData(GLenum, DOMArrayBufferView*, GLenum, GLuint, GLuint);
35 void bufferSubData(GLenum, GLintptr, DOMArrayBufferView*, GLuint, GLuint); 35 void bufferSubData(GLenum, GLintptr, DOMArrayBufferView*, GLuint, GLuint);
36 // Have to re-declare/re-define the following buffer{Sub}Data functions from 36 // Have to re-declare/re-define the following buffer{Sub}Data functions from
37 // base class. This is because the above buffer{Sub}Data() hides the name 37 // base class. This is because the above buffer{Sub}Data() hides the name
38 // from base class. 38 // from base class.
39 void bufferData(GLenum target, long long size, GLenum usage); 39 void bufferData(GLenum target, long long size, GLenum usage);
40 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage); 40 void bufferData(GLenum target, DOMArrayBuffer* data, GLenum usage);
41 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage); 41 void bufferData(GLenum target, DOMArrayBufferView* data, GLenum usage);
42 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data); 42 void bufferSubData(GLenum target, long long offset, DOMArrayBuffer* data);
43 void bufferSubData(GLenum target, 43 void bufferSubData(GLenum target,
44 long long offset, 44 long long offset,
45 const FlexibleArrayBufferView& data); 45 const FlexibleArrayBufferView& data);
46 46
47 void copyBufferSubData(GLenum, GLenum, long long, long long, long long); 47 void copyBufferSubData(GLenum, GLenum, long long, long long, long long);
48 void getBufferSubData(GLenum, long long, DOMArrayBufferView*, GLuint, GLuint); 48 void getBufferSubData(GLenum, long long, DOMArrayBufferView*, GLuint, GLuint);
49 ScriptPromise getBufferSubDataAsync(ScriptState*,
50 GLenum target,
51 GLintptr srcByteOffset,
52 DOMArrayBufferView*,
53 GLuint dstOffset,
54 GLuint length);
55 49
56 void registerGetBufferSubDataAsyncCallback( 50 void registerGetBufferSubDataAsyncCallback(
57 WebGLGetBufferSubDataAsyncCallback*); 51 WebGLGetBufferSubDataAsyncCallback*);
58 void unregisterGetBufferSubDataAsyncCallback( 52 void unregisterGetBufferSubDataAsyncCallback(
59 WebGLGetBufferSubDataAsyncCallback*); 53 WebGLGetBufferSubDataAsyncCallback*);
60 54
61 /* Framebuffer objects */ 55 /* Framebuffer objects */
62 bool validateTexFuncLayer(const char*, GLenum texTarget, GLint layer); 56 bool validateTexFuncLayer(const char*, GLenum texTarget, GLint layer);
63 void blitFramebuffer(GLint, 57 void blitFramebuffer(GLint,
64 GLint, 58 GLint,
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 GLenum format, 734 GLenum format,
741 GLenum type, 735 GLenum type,
742 DOMArrayBufferView* pixels) override; 736 DOMArrayBufferView* pixels) override;
743 void restoreCurrentFramebuffer() override; 737 void restoreCurrentFramebuffer() override;
744 738
745 DECLARE_VIRTUAL_TRACE(); 739 DECLARE_VIRTUAL_TRACE();
746 DECLARE_VIRTUAL_TRACE_WRAPPERS(); 740 DECLARE_VIRTUAL_TRACE_WRAPPERS();
747 741
748 protected: 742 protected:
749 friend class V8WebGL2RenderingContext; 743 friend class V8WebGL2RenderingContext;
744 friend class WebGLGetBufferSubDataAsync;
750 745
751 WebGL2RenderingContextBase( 746 WebGL2RenderingContextBase(
752 HTMLCanvasElement*, 747 HTMLCanvasElement*,
753 std::unique_ptr<WebGraphicsContext3DProvider>, 748 std::unique_ptr<WebGraphicsContext3DProvider>,
754 const CanvasContextCreationAttributes& requestedAttributes); 749 const CanvasContextCreationAttributes& requestedAttributes);
755 WebGL2RenderingContextBase( 750 WebGL2RenderingContextBase(
756 OffscreenCanvas*, 751 OffscreenCanvas*,
757 std::unique_ptr<WebGraphicsContext3DProvider>, 752 std::unique_ptr<WebGraphicsContext3DProvider>,
758 const CanvasContextCreationAttributes& requestedAttributes); 753 const CanvasContextCreationAttributes& requestedAttributes);
759 754
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 context, 916 context,
922 context->is3d() && 917 context->is3d() &&
923 WebGLRenderingContextBase::getWebGLVersion(context) >= 2, 918 WebGLRenderingContextBase::getWebGLVersion(context) >= 2,
924 context.is3d() && 919 context.is3d() &&
925 WebGLRenderingContextBase::getWebGLVersion(&context) >= 920 WebGLRenderingContextBase::getWebGLVersion(&context) >=
926 2); 921 2);
927 922
928 } // namespace blink 923 } // namespace blink
929 924
930 #endif 925 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698