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

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

Issue 2379203002: implement getBufferSubDataAsync prototype (Closed)
Patch Set: rebase + clean up some XXXs Created 4 years, 2 months 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/WebGL2RenderingContextBase.h
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
index 23479a91c40c872683f81e18756676d6259718c6..dacce91ebb7852be55d6c224138a406d69cd159d 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
@@ -5,6 +5,7 @@
#ifndef WebGL2RenderingContextBase_h
#define WebGL2RenderingContextBase_h
+#include "bindings/core/v8/ScriptPromise.h"
#include "modules/webgl/WebGLExtension.h"
#include "modules/webgl/WebGLRenderingContextBase.h"
#include <memory>
@@ -27,6 +28,8 @@ class WebGL2RenderingContextBase : public WebGLRenderingContextBase {
public:
~WebGL2RenderingContextBase() override;
+ void destroyContext() override;
+
/* Buffer objects */
void bufferData(GLenum, DOMArrayBufferView*, GLenum, GLuint, GLuint);
void bufferSubData(GLenum, GLintptr, DOMArrayBufferView*, GLuint, GLuint);
@@ -43,6 +46,12 @@ class WebGL2RenderingContextBase : public WebGLRenderingContextBase {
void copyBufferSubData(GLenum, GLenum, long long, long long, long long);
void getBufferSubData(GLenum, long long, DOMArrayBufferView*, GLuint, GLuint);
+ ScriptPromise getBufferSubDataAsync(ScriptState*,
+ GLenum,
+ GLintptr,
+ DOMArrayBufferView*,
+ GLuint,
+ GLuint);
/* Framebuffer objects */
bool validateTexFuncLayer(const char*, GLenum texTarget, GLint layer);
@@ -811,6 +820,32 @@ class WebGL2RenderingContextBase : public WebGLRenderingContextBase {
GLenum target) override;
bool validateBufferDataUsage(const char* functionName, GLenum usage) override;
+ class GetBufferSubDataAsyncCallback
+ : public RefCounted<GetBufferSubDataAsyncCallback> {
esprehn 2016/10/08 03:02:49 Does this need to be a nested class?
Kai Ninomiya 2016/10/11 01:34:14 I'll simplify this.
+ private:
Ken Russell (switch to Gerrit) 2016/10/10 22:21:30 Per the Google C++ style guide at https://google.g
Kai Ninomiya 2016/10/11 01:34:14 Done.
+ WeakPersistent<WebGL2RenderingContextBase> context;
+ Persistent<DOMArrayBufferView> dstData;
esprehn 2016/10/08 03:02:49 We don't generally abbreviate in blink, does the s
Kai Ninomiya 2016/10/11 01:34:14 Yes, the spec uses "dst." However, it does not nee
+ Persistent<ScriptPromiseResolver> resolver;
+ void* subBaseAddress;
Ken Russell (switch to Gerrit) 2016/10/10 22:21:30 These variables could use some comments. Also, ple
+ void* mappedData;
+ long long subByteLength;
esprehn 2016/10/08 03:02:49 Very few things in blink can actually handle somet
Ken Russell (switch to Gerrit) 2016/10/10 22:21:30 It represents the amount of data read back from th
Kai Ninomiya 2016/10/11 01:34:14 esprehn: Excellent point, I agree. If it's alright
+
+ public:
+ GetBufferSubDataAsyncCallback(WebGL2RenderingContextBase*,
+ DOMArrayBufferView*,
+ ScriptPromiseResolver*,
+ void*,
+ void*,
+ long long);
+ void destroy();
+ static void resolve(GetBufferSubDataAsyncCallback*);
+ };
+
+ std::set<GetBufferSubDataAsyncCallback*> m_getBufferSubDataAsyncCallbacks;
+
+ void registerGetBufferSubDataAsyncCallback(GetBufferSubDataAsyncCallback*);
+ void unregisterGetBufferSubDataAsyncCallback(GetBufferSubDataAsyncCallback*);
+
bool canUseTexImageByGPU(TexImageFunctionID,
GLint internalformat,
GLenum type) override;

Powered by Google App Engine
This is Rietveld 408576698