OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 UI_GL_ASYNC_TASK_DELEGATE_STUB_H_ |
| 6 #define UI_GL_ASYNC_TASK_DELEGATE_STUB_H_ |
| 7 |
| 8 #include "ui/gl/async_pixel_transfer_delegate.h" |
| 9 |
| 10 namespace gfx { |
| 11 |
| 12 class AsyncTransferStateStub : public AsyncPixelTransferState { |
| 13 public: |
| 14 // implement AsyncPixelTransferState: |
| 15 virtual bool TransferIsInProgress() OVERRIDE; |
| 16 virtual bool BindTransfer( |
| 17 GLenum target, AsyncTexImage2DParams* bound_params) OVERRIDE; |
| 18 |
| 19 private: |
| 20 friend class AsyncPixelTransferDelegateStub; |
| 21 bool needs_late_bind_; |
| 22 AsyncTexImage2DParams late_bind_define_params_ ; |
| 23 |
| 24 explicit AsyncTransferStateStub(GLuint texture_id); |
| 25 virtual ~AsyncTransferStateStub(); |
| 26 DISALLOW_COPY_AND_ASSIGN(AsyncTransferStateStub); |
| 27 }; |
| 28 |
| 29 // Class which handles async pixel transfers (as a fallback). |
| 30 // This class just does the uploads synchronously. |
| 31 class AsyncPixelTransferDelegateStub : public AsyncPixelTransferDelegate { |
| 32 public: |
| 33 static scoped_ptr<AsyncPixelTransferDelegate> |
| 34 Create(gfx::GLContext* context); |
| 35 |
| 36 AsyncPixelTransferDelegateStub(); |
| 37 virtual ~AsyncPixelTransferDelegateStub(); |
| 38 |
| 39 // implement AsyncPixelTransferDelegate: |
| 40 virtual scoped_refptr<AsyncPixelTransferState> |
| 41 CreatePixelTransferState(GLuint texture_id) OVERRIDE; |
| 42 virtual void AsyncNotifyCompletion(const base::Closure& task) OVERRIDE; |
| 43 virtual void AsyncTexImage2D( |
| 44 AsyncPixelTransferState* transfer_state, |
| 45 const AsyncTexImage2DParams& tex_params, |
| 46 const AsyncMemoryParams& mem_params) OVERRIDE; |
| 47 virtual void AsyncTexSubImage2D( |
| 48 AsyncPixelTransferState* transfer_state, |
| 49 const AsyncTexSubImage2DParams& tex_params, |
| 50 const AsyncMemoryParams& mem_params) OVERRIDE; |
| 51 |
| 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub); |
| 54 }; |
| 55 |
| 56 } // namespace gfx |
| 57 |
| 58 #endif // UI_GL_ASYNC_TASK_DELEGATE_ANDROID_H_ |
| 59 |
OLD | NEW |