- add sources.
[platform/framework/web/crosswalk.git] / src / gpu / command_buffer / service / async_pixel_transfer_manager_stub.cc
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
3 // found in the LICENSE file.
4
5 #include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
6
7 #include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
8
9 namespace gpu {
10
11 class AsyncPixelTransferDelegateStub : public AsyncPixelTransferDelegate {
12  public:
13   AsyncPixelTransferDelegateStub();
14   virtual ~AsyncPixelTransferDelegateStub();
15
16   // Implement AsyncPixelTransferDelegate:
17   virtual void AsyncTexImage2D(
18       const AsyncTexImage2DParams& tex_params,
19       const AsyncMemoryParams& mem_params,
20       const base::Closure& bind_callback) OVERRIDE;
21   virtual void AsyncTexSubImage2D(
22       const AsyncTexSubImage2DParams& tex_params,
23       const AsyncMemoryParams& mem_params) OVERRIDE;
24   virtual bool TransferIsInProgress() OVERRIDE;
25   virtual void WaitForTransferCompletion() OVERRIDE;
26
27  private:
28   DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub);
29 };
30
31 AsyncPixelTransferDelegateStub::AsyncPixelTransferDelegateStub() {}
32
33 AsyncPixelTransferDelegateStub::~AsyncPixelTransferDelegateStub() {}
34
35 void AsyncPixelTransferDelegateStub::AsyncTexImage2D(
36     const AsyncTexImage2DParams& tex_params,
37     const AsyncMemoryParams& mem_params,
38     const base::Closure& bind_callback) {
39   bind_callback.Run();
40 }
41
42 void AsyncPixelTransferDelegateStub::AsyncTexSubImage2D(
43     const AsyncTexSubImage2DParams& tex_params,
44     const AsyncMemoryParams& mem_params) {
45 }
46
47 bool AsyncPixelTransferDelegateStub::TransferIsInProgress() {
48   return false;
49 }
50
51 void AsyncPixelTransferDelegateStub::WaitForTransferCompletion() {}
52
53 AsyncPixelTransferManagerStub::AsyncPixelTransferManagerStub() {}
54
55 AsyncPixelTransferManagerStub::~AsyncPixelTransferManagerStub() {}
56
57 void AsyncPixelTransferManagerStub::BindCompletedAsyncTransfers() {
58 }
59
60 void AsyncPixelTransferManagerStub::AsyncNotifyCompletion(
61     const AsyncMemoryParams& mem_params,
62     AsyncPixelTransferCompletionObserver* observer) {
63   observer->DidComplete(mem_params);
64 }
65
66 uint32 AsyncPixelTransferManagerStub::GetTextureUploadCount() {
67   return 0;
68 }
69
70 base::TimeDelta AsyncPixelTransferManagerStub::GetTotalTextureUploadTime() {
71   return base::TimeDelta();
72 }
73
74 void AsyncPixelTransferManagerStub::ProcessMorePendingTransfers() {
75 }
76
77 bool AsyncPixelTransferManagerStub::NeedsProcessMorePendingTransfers() {
78   return false;
79 }
80
81 AsyncPixelTransferDelegate*
82 AsyncPixelTransferManagerStub::CreatePixelTransferDelegateImpl(
83     gles2::TextureRef* ref,
84     const AsyncTexImage2DParams& define_params) {
85   return new AsyncPixelTransferDelegateStub();
86 }
87
88 }  // namespace gpu