| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h" | 5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_idle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/debug/trace_event_synthetic_delay.h" | 9 #include "base/debug/trace_event_synthetic_delay.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Class which handles async pixel transfers in a platform | 29 // Class which handles async pixel transfers in a platform |
| 30 // independent way. | 30 // independent way. |
| 31 class AsyncPixelTransferDelegateIdle | 31 class AsyncPixelTransferDelegateIdle |
| 32 : public AsyncPixelTransferDelegate, | 32 : public AsyncPixelTransferDelegate, |
| 33 public base::SupportsWeakPtr<AsyncPixelTransferDelegateIdle> { | 33 public base::SupportsWeakPtr<AsyncPixelTransferDelegateIdle> { |
| 34 public: | 34 public: |
| 35 AsyncPixelTransferDelegateIdle( | 35 AsyncPixelTransferDelegateIdle( |
| 36 AsyncPixelTransferManagerIdle::SharedState* state, | 36 AsyncPixelTransferManagerIdle::SharedState* state, |
| 37 GLuint texture_id, | 37 GLuint texture_id, |
| 38 const AsyncTexImage2DParams& define_params); | 38 const AsyncTexImage2DParams& define_params); |
| 39 virtual ~AsyncPixelTransferDelegateIdle(); | 39 ~AsyncPixelTransferDelegateIdle() override; |
| 40 | 40 |
| 41 // Implement AsyncPixelTransferDelegate: | 41 // Implement AsyncPixelTransferDelegate: |
| 42 virtual void AsyncTexImage2D( | 42 void AsyncTexImage2D(const AsyncTexImage2DParams& tex_params, |
| 43 const AsyncTexImage2DParams& tex_params, | 43 const AsyncMemoryParams& mem_params, |
| 44 const AsyncMemoryParams& mem_params, | 44 const base::Closure& bind_callback) override; |
| 45 const base::Closure& bind_callback) override; | 45 void AsyncTexSubImage2D(const AsyncTexSubImage2DParams& tex_params, |
| 46 virtual void AsyncTexSubImage2D( | 46 const AsyncMemoryParams& mem_params) override; |
| 47 const AsyncTexSubImage2DParams& tex_params, | 47 bool TransferIsInProgress() override; |
| 48 const AsyncMemoryParams& mem_params) override; | 48 void WaitForTransferCompletion() override; |
| 49 virtual bool TransferIsInProgress() override; | |
| 50 virtual void WaitForTransferCompletion() override; | |
| 51 | 49 |
| 52 private: | 50 private: |
| 53 void PerformAsyncTexImage2D(AsyncTexImage2DParams tex_params, | 51 void PerformAsyncTexImage2D(AsyncTexImage2DParams tex_params, |
| 54 AsyncMemoryParams mem_params, | 52 AsyncMemoryParams mem_params, |
| 55 const base::Closure& bind_callback); | 53 const base::Closure& bind_callback); |
| 56 void PerformAsyncTexSubImage2D(AsyncTexSubImage2DParams tex_params, | 54 void PerformAsyncTexSubImage2D(AsyncTexSubImage2DParams tex_params, |
| 57 AsyncMemoryParams mem_params); | 55 AsyncMemoryParams mem_params); |
| 58 | 56 |
| 59 uint64 id_; | 57 uint64 id_; |
| 60 GLuint texture_id_; | 58 GLuint texture_id_; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 AsyncPixelTransferDelegate* | 313 AsyncPixelTransferDelegate* |
| 316 AsyncPixelTransferManagerIdle::CreatePixelTransferDelegateImpl( | 314 AsyncPixelTransferManagerIdle::CreatePixelTransferDelegateImpl( |
| 317 gles2::TextureRef* ref, | 315 gles2::TextureRef* ref, |
| 318 const AsyncTexImage2DParams& define_params) { | 316 const AsyncTexImage2DParams& define_params) { |
| 319 return new AsyncPixelTransferDelegateIdle(&shared_state_, | 317 return new AsyncPixelTransferDelegateIdle(&shared_state_, |
| 320 ref->service_id(), | 318 ref->service_id(), |
| 321 define_params); | 319 define_params); |
| 322 } | 320 } |
| 323 | 321 |
| 324 } // namespace gpu | 322 } // namespace gpu |
| OLD | NEW |