1868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
2868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)// found in the LICENSE file.
4868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
5868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "gpu/command_buffer/service/async_pixel_transfer_manager_stub.h"
6868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
7868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "gpu/command_buffer/service/async_pixel_transfer_delegate.h"
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
9868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)namespace gpu {
10868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
11868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)class AsyncPixelTransferDelegateStub : public AsyncPixelTransferDelegate {
12868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) public:
13868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  AsyncPixelTransferDelegateStub();
14868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual ~AsyncPixelTransferDelegateStub();
15868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
16868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  // Implement AsyncPixelTransferDelegate:
17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void AsyncTexImage2D(
18868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const AsyncTexImage2DParams& tex_params,
19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const AsyncMemoryParams& mem_params,
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const base::Closure& bind_callback) OVERRIDE;
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  virtual void AsyncTexSubImage2D(
22868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const AsyncTexSubImage2DParams& tex_params,
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)      const AsyncMemoryParams& mem_params) OVERRIDE;
247d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  virtual bool TransferIsInProgress() OVERRIDE;
257d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  virtual void WaitForTransferCompletion() OVERRIDE;
26868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
27868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) private:
28868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub);
29868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)};
30868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
31868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)AsyncPixelTransferDelegateStub::AsyncPixelTransferDelegateStub() {}
32868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
33868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)AsyncPixelTransferDelegateStub::~AsyncPixelTransferDelegateStub() {}
34868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
35868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void AsyncPixelTransferDelegateStub::AsyncTexImage2D(
36868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const AsyncTexImage2DParams& tex_params,
37868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const AsyncMemoryParams& mem_params,
38868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const base::Closure& bind_callback) {
39868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  bind_callback.Run();
40868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
41868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
42868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void AsyncPixelTransferDelegateStub::AsyncTexSubImage2D(
43868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const AsyncTexSubImage2DParams& tex_params,
44868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const AsyncMemoryParams& mem_params) {
45868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
46868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
477d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)bool AsyncPixelTransferDelegateStub::TransferIsInProgress() {
487d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  return false;
49868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
50868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)void AsyncPixelTransferDelegateStub::WaitForTransferCompletion() {}
527d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)
537d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)AsyncPixelTransferManagerStub::AsyncPixelTransferManagerStub() {}
54868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
55868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)AsyncPixelTransferManagerStub::~AsyncPixelTransferManagerStub() {}
56868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
57868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void AsyncPixelTransferManagerStub::BindCompletedAsyncTransfers() {
58868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
59868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
60868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void AsyncPixelTransferManagerStub::AsyncNotifyCompletion(
61868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    const AsyncMemoryParams& mem_params,
62eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch    AsyncPixelTransferCompletionObserver* observer) {
63eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch  observer->DidComplete(mem_params);
64868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
65868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
66868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)uint32 AsyncPixelTransferManagerStub::GetTextureUploadCount() {
67868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return 0;
68868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
69868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
70868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)base::TimeDelta AsyncPixelTransferManagerStub::GetTotalTextureUploadTime() {
71868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return base::TimeDelta();
72868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
73868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
74868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void AsyncPixelTransferManagerStub::ProcessMorePendingTransfers() {
75868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
76868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
77868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)bool AsyncPixelTransferManagerStub::NeedsProcessMorePendingTransfers() {
78868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  return false;
79868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
80868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
814ad1aa43a48567659193a298fad74f55e00b3dd9Ben Murdochvoid AsyncPixelTransferManagerStub::WaitAllAsyncTexImage2D() {
824ad1aa43a48567659193a298fad74f55e00b3dd9Ben Murdoch}
834ad1aa43a48567659193a298fad74f55e00b3dd9Ben Murdoch
84868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)AsyncPixelTransferDelegate*
857d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)AsyncPixelTransferManagerStub::CreatePixelTransferDelegateImpl(
867d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    gles2::TextureRef* ref,
877d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)    const AsyncTexImage2DParams& define_params) {
887d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)  return new AsyncPixelTransferDelegateStub();
89868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
90868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
91868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}  // namespace gpu
92