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

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

Issue 13543007: GLImage support for Android zero-copy pixel buffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/PixelBuffer/GpuMemoryBuffer/ Created 7 years, 8 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) 2012 The Chromium Authors. All rights reserved. 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 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_GL_IMAGE_H_ 5 #ifndef UI_GL_GL_IMAGE_H_
6 #define UI_GL_GL_IMAGE_H_ 6 #define UI_GL_GL_IMAGE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/size.h" 10 #include "ui/gfx/size.h"
11 #include "ui/gl/gl_bindings.h"
12 #include "ui/gl/gl_export.h" 11 #include "ui/gl/gl_export.h"
13 12
14 namespace gfx { 13 namespace gfx {
15 14
16 class GLSurface; 15 class GLSurface;
17 16
18 // Encapsulates an image that can be bound to a texture, hiding platform 17 // Encapsulates an image that can be bound to a texture, hiding platform
19 // specific management. 18 // specific management.
20 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { 19 class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
21 public: 20 public:
22 GLImage(); 21 GLImage();
23 22
24 // Destroys the image. 23 // Destroys the image.
25 virtual void Destroy() = 0; 24 virtual void Destroy() = 0;
26 25
27 // Get the size of the image. 26 // Get the size of the image.
28 virtual gfx::Size GetSize() = 0; 27 virtual gfx::Size GetSize() = 0;
29 28
30 // Bind image to texture currently bound to GL_TEXTURE_2D target. 29 // Bind image to texture currently bound to GL_TEXTURE_2D target.
31 virtual bool BindTexImage(); 30 virtual bool BindTexImage();
32 31
33 // Release image from texture currently bound to GL_TEXTURE_2D target. 32 // Release image from texture currently bound to GL_TEXTURE_2D target.
34 virtual void ReleaseTexImage(); 33 virtual void ReleaseTexImage();
35 34
36 // Create a GL image for a window. 35 // Create a GL image for a window.
37 static scoped_refptr<GLImage> CreateGLImage(gfx::PluginWindowHandle window); 36 static scoped_refptr<GLImage> CreateGLImage(gfx::PluginWindowHandle window);
38 37
38 // Create a GL image for a GPU Memory buffer.
39 static scoped_refptr<GLImage> CreateGLImageForGpuMemoryBuffer(
40 gfx::GpuMemoryBufferHandle buffer, const gfx::Size& size);
no sievers 2013/04/05 22:16:34 nit: gfx::Size by value
kaanb 2013/04/08 15:48:11 Done.
41
39 protected: 42 protected:
40 virtual ~GLImage(); 43 virtual ~GLImage();
41 44
42 private: 45 private:
43 friend class base::RefCounted<GLImage>; 46 friend class base::RefCounted<GLImage>;
44 47
45 DISALLOW_COPY_AND_ASSIGN(GLImage); 48 DISALLOW_COPY_AND_ASSIGN(GLImage);
46 }; 49 };
47 50
48 } // namespace gfx 51 } // namespace gfx
49 52
50 #endif // UI_GL_GL_IMAGE_H_ 53 #endif // UI_GL_GL_IMAGE_H_
OLDNEW
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_image_android.cc » ('j') | ui/gl/gl_image_egl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698