Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: ui/gl/async_pixel_transfer_delegate_stub.h

Issue 11428140: gpu: Add async pixel transfer interface, stub and tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix bots. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 void BindTransfer(AsyncTexImage2DParams* bound_params) OVERRIDE;
17
18 private:
19 friend class AsyncPixelTransferDelegateStub;
20 bool needs_late_bind_;
21 AsyncTexImage2DParams late_bind_define_params_ ;
22
23 explicit AsyncTransferStateStub(GLuint texture_id);
24 virtual ~AsyncTransferStateStub();
25 DISALLOW_COPY_AND_ASSIGN(AsyncTransferStateStub);
26 };
27
28 // Class which handles async pixel transfers (as a fallback).
29 // This class just does the uploads synchronously.
30 class AsyncPixelTransferDelegateStub : public AsyncPixelTransferDelegate {
31 public:
32 static scoped_ptr<AsyncPixelTransferDelegate>
33 Create(gfx::GLContext* context);
34
35 AsyncPixelTransferDelegateStub();
36 virtual ~AsyncPixelTransferDelegateStub();
37
38 // implement AsyncPixelTransferDelegate:
39 virtual scoped_ptr<AsyncPixelTransferState>
40 CreatePixelTransferState(GLuint texture_id) OVERRIDE;
41 virtual void AsyncNotifyCompletion(const base::Closure& task) OVERRIDE;
42 virtual void AsyncTexImage2D(
43 AsyncPixelTransferState* transfer_state,
44 const AsyncTexImage2DParams& tex_params,
45 const AsyncMemoryParams& mem_params) OVERRIDE;
46 virtual void AsyncTexSubImage2D(
47 AsyncPixelTransferState* transfer_state,
48 const AsyncTexSubImage2DParams& tex_params,
49 const AsyncMemoryParams& mem_params) OVERRIDE;
50 private:
51 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD.
52 virtual AsyncPixelTransferState*
53 CreateRawPixelTransferState(GLuint texture_id) OVERRIDE;
54
55 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegateStub);
56 };
57
58 } // namespace gfx
59
60 #endif // UI_GL_ASYNC_TASK_DELEGATE_ANDROID_H_
61
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698