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

Side by Side Diff: ui/gl/async_pixel_transfer_delegate.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: 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) 2011 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_H_
apatrick 2012/12/03 21:23:59 At first I was like, this definitely shouldn't be
epennerAtGoogle 2012/12/03 22:48:45 I initially had this code in gpu/ but ran into pro
6 #define UI_GL_ASYNC_TASK_DELEGATE_H_
7
8 #include "base/basictypes.h"
9
10 namespace gfx {
11
12 // AsyncPixelTransferState holds the resources required to do async
13 // transfers on one texture. It should stay alive for the lifetime
14 // of the texture to allow multiple transfers.
15 class AsyncPixelTransferState
greggman 2012/12/05 02:23:42 I'm just guessing that in order for this to work i
epenner 2012/12/08 03:15:03 Done.
16 : public base::RefCounted<AsyncPixelTransferState> {
apatrick 2012/12/03 21:23:59 RefCountedThreadSafe will do atomic increment / de
epennerAtGoogle 2012/12/03 22:48:45 Currently lifetime for this object is controlled e
17 public:
18 AsyncPixelTransferState() {}
19 virtual ~AsyncPixelTransferState() {};
20 private:
greggman 2012/12/05 02:23:42 nit: one empty line before private
epenner 2012/12/08 03:15:03 Done.
21 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState);
22 };
23
24
25 class AsyncPixelTransferDelegate {
26 public:
27 // TODO: Should this be owned by a GPU process object?
28 // We only need one in the GPU process, so this is currently
29 // just a lazy instance.
30 static AsyncPixelTransferDelegate* Get();
31
32 virtual scoped_refptr<AsyncPixelTransferState>
33 CreatePixelTransferState(GLuint texture) = 0;
34
35 virtual void AsyncNotifyCompletion(
36 const base::Closure& task) = 0;
37
38 virtual void AsyncTexSubImage2D(
39 AsyncPixelTransferState*,
40 GLenum target,
41 GLint level,
42 GLint xoffset,
43 GLint yoffset,
44 GLsizei width,
45 GLsizei height,
46 GLenum format,
47 GLenum type,
48 const void* data) = 0;
49
50 protected:
51 AsyncPixelTransferDelegate() {}
52 virtual ~AsyncPixelTransferDelegate() {}
53 private:
greggman 2012/12/05 02:23:42 nit: one empty line before private
epenner 2012/12/08 03:15:03 Done.
54 DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate);
55 };
56
57 } // namespace gfx
58
59 #endif // UI_GL_ASYNC_TASK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698