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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ui/gl/async_pixel_transfer_delegate.h
diff --git a/ui/gl/async_pixel_transfer_delegate.h b/ui/gl/async_pixel_transfer_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1946bb35499608c189c8a26e9594a9509926372
--- /dev/null
+++ b/ui/gl/async_pixel_transfer_delegate.h
@@ -0,0 +1,59 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#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
+#define UI_GL_ASYNC_TASK_DELEGATE_H_
+
+#include "base/basictypes.h"
+
+namespace gfx {
+
+// AsyncPixelTransferState holds the resources required to do async
+// transfers on one texture. It should stay alive for the lifetime
+// of the texture to allow multiple transfers.
+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.
+ : 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
+ public:
+ AsyncPixelTransferState() {}
+ virtual ~AsyncPixelTransferState() {};
+ private:
greggman 2012/12/05 02:23:42 nit: one empty line before private
epenner 2012/12/08 03:15:03 Done.
+ DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferState);
+};
+
+
+class AsyncPixelTransferDelegate {
+ public:
+ // TODO: Should this be owned by a GPU process object?
+ // We only need one in the GPU process, so this is currently
+ // just a lazy instance.
+ static AsyncPixelTransferDelegate* Get();
+
+ virtual scoped_refptr<AsyncPixelTransferState>
+ CreatePixelTransferState(GLuint texture) = 0;
+
+ virtual void AsyncNotifyCompletion(
+ const base::Closure& task) = 0;
+
+ virtual void AsyncTexSubImage2D(
+ AsyncPixelTransferState*,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const void* data) = 0;
+
+ protected:
+ AsyncPixelTransferDelegate() {}
+ virtual ~AsyncPixelTransferDelegate() {}
+ private:
greggman 2012/12/05 02:23:42 nit: one empty line before private
epenner 2012/12/08 03:15:03 Done.
+ DISALLOW_COPY_AND_ASSIGN(AsyncPixelTransferDelegate);
+};
+
+} // namespace gfx
+
+#endif // UI_GL_ASYNC_TASK_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698