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

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

Issue 12211144: Revert 181883 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_GL_ASYNC_TASK_DELEGATE_H_ 5 #ifndef UI_GL_ASYNC_TASK_DELEGATE_H_
6 #define UI_GL_ASYNC_TASK_DELEGATE_H_ 6 #define UI_GL_ASYNC_TASK_DELEGATE_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 friend class base::RefCounted<AsyncPixelTransferState>; 71 friend class base::RefCounted<AsyncPixelTransferState>;
72 AsyncPixelTransferState() {} 72 AsyncPixelTransferState() {}
73 73
74 74
75 private: 75 private:
76 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState); 76 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState);
77 }; 77 };
78 78
79 class GL_EXPORT AsyncPixelTransferDelegate { 79 class GL_EXPORT AsyncPixelTransferDelegate {
80 public: 80 public:
81 typedef base::Callback<void(const AsyncMemoryParams&)> CompletionCallback;
82
83 static scoped_ptr<AsyncPixelTransferDelegate> 81 static scoped_ptr<AsyncPixelTransferDelegate>
84 Create(gfx::GLContext* context); 82 Create(gfx::GLContext* context);
85 virtual ~AsyncPixelTransferDelegate() {} 83 virtual ~AsyncPixelTransferDelegate() {}
86 84
87 // This wouldn't work with MOCK_METHOD, so it routes through 85 // This wouldn't work with MOCK_METHOD, so it routes through
88 // a virtual protected version which returns a raw pointer. 86 // a virtual protected version which returns a raw pointer.
89 scoped_ptr<AsyncPixelTransferState> 87 scoped_ptr<AsyncPixelTransferState>
90 CreatePixelTransferState(GLuint texture_id) { 88 CreatePixelTransferState(GLuint texture_id) {
91 return make_scoped_ptr(CreateRawPixelTransferState(texture_id)); 89 return make_scoped_ptr(CreateRawPixelTransferState(texture_id));
92 } 90 }
93 91
94 // There's no guarantee that callback will run on the caller thread.
95 virtual void AsyncNotifyCompletion( 92 virtual void AsyncNotifyCompletion(
96 const AsyncMemoryParams& mem_params, 93 const base::Closure& notify_task) = 0;
97 const CompletionCallback& callback) = 0;
98 94
99 virtual void AsyncTexImage2D( 95 virtual void AsyncTexImage2D(
100 AsyncPixelTransferState* state, 96 AsyncPixelTransferState* state,
101 const AsyncTexImage2DParams& tex_params, 97 const AsyncTexImage2DParams& tex_params,
102 const AsyncMemoryParams& mem_params) = 0; 98 const AsyncMemoryParams& mem_params) = 0;
103 99
104 virtual void AsyncTexSubImage2D( 100 virtual void AsyncTexSubImage2D(
105 AsyncPixelTransferState* state, 101 AsyncPixelTransferState* state,
106 const AsyncTexSubImage2DParams& tex_params, 102 const AsyncTexSubImage2DParams& tex_params,
107 const AsyncMemoryParams& mem_params) = 0; 103 const AsyncMemoryParams& mem_params) = 0;
108 104
109 virtual uint32 GetTextureUploadCount() = 0; 105 virtual uint32 GetTextureUploadCount() = 0;
110 virtual base::TimeDelta GetTotalTextureUploadTime() = 0; 106 virtual base::TimeDelta GetTotalTextureUploadTime() = 0;
111 107
112 protected: 108 protected:
113 AsyncPixelTransferDelegate() {} 109 AsyncPixelTransferDelegate() {}
114 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD. 110 // For testing, as returning scoped_ptr wouldn't work with MOCK_METHOD.
115 virtual AsyncPixelTransferState* 111 virtual AsyncPixelTransferState*
116 CreateRawPixelTransferState(GLuint texture_id) = 0; 112 CreateRawPixelTransferState(GLuint texture_id) = 0;
117 113
118 private: 114 private:
119 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate); 115 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate);
120 }; 116 };
121 117
122 } // namespace gfx 118 } // namespace gfx
123 119
124 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_ 120 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_
125 121
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/query_manager.cc ('k') | ui/gl/async_pixel_transfer_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698