| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebGLGetBufferSubDataAsync_h |
| 6 #define WebGLGetBufferSubDataAsync_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "modules/webgl/WebGLExtension.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class WebGL2RenderingContextBase; |
| 14 |
| 15 class WebGLGetBufferSubDataAsync final : public WebGLExtension { |
| 16 DEFINE_WRAPPERTYPEINFO(); |
| 17 |
| 18 public: |
| 19 static WebGLGetBufferSubDataAsync* create(WebGLRenderingContextBase*); |
| 20 static bool supported(WebGLRenderingContextBase*); |
| 21 static const char* extensionName(); |
| 22 |
| 23 WebGLExtensionName name() const override; |
| 24 |
| 25 ScriptPromise getBufferSubDataAsync(ScriptState*, |
| 26 GLenum target, |
| 27 GLintptr srcByteOffset, |
| 28 DOMArrayBufferView*, |
| 29 GLuint dstOffset, |
| 30 GLuint length); |
| 31 |
| 32 private: |
| 33 explicit WebGLGetBufferSubDataAsync(WebGLRenderingContextBase*); |
| 34 }; |
| 35 |
| 36 class WebGLGetBufferSubDataAsyncCallback |
| 37 : public GarbageCollected<WebGLGetBufferSubDataAsyncCallback> { |
| 38 public: |
| 39 WebGLGetBufferSubDataAsyncCallback(WebGL2RenderingContextBase*, |
| 40 ScriptPromiseResolver*, |
| 41 void* shmReadbackResultData, |
| 42 GLuint commandsIssuedQueryID, |
| 43 DOMArrayBufferView*, |
| 44 void* destinationDataPtr, |
| 45 long long destinationByteLength); |
| 46 |
| 47 void destroy(); |
| 48 |
| 49 void resolve(); |
| 50 |
| 51 DECLARE_TRACE(); |
| 52 |
| 53 private: |
| 54 WeakMember<WebGL2RenderingContextBase> m_context; |
| 55 Member<ScriptPromiseResolver> m_promiseResolver; |
| 56 |
| 57 // Pointer to shared memory where the gpu readback result is stored. |
| 58 void* m_shmReadbackResultData; |
| 59 // ID of the GL query used to call this callback. |
| 60 GLuint m_commandsIssuedQueryID; |
| 61 |
| 62 // ArrayBufferView returned from the promise. |
| 63 Member<DOMArrayBufferView> m_destinationArrayBufferView; |
| 64 // Pointer into the offset into destinationArrayBufferView. |
| 65 void* m_destinationDataPtr; |
| 66 // Size in bytes of the copy operation being performed. |
| 67 long long m_destinationByteLength; |
| 68 }; |
| 69 |
| 70 } // namespace blink |
| 71 |
| 72 #endif // WebGLGetBufferSubDataAsync_h |
| OLD | NEW |