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

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

Issue 1140683002: glBindTexImage2DCHROMIUM should retain pixel format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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/geometry/rect.h" 9 #include "ui/gfx/geometry/rect.h"
10 #include "ui/gfx/geometry/rect_f.h" 10 #include "ui/gfx/geometry/rect_f.h"
11 #include "ui/gfx/geometry/size.h" 11 #include "ui/gfx/geometry/size.h"
12 #include "ui/gfx/native_widget_types.h" 12 #include "ui/gfx/native_widget_types.h"
13 #include "ui/gfx/overlay_transform.h" 13 #include "ui/gfx/overlay_transform.h"
14 #include "ui/gl/gl_export.h" 14 #include "ui/gl/gl_export.h"
15 15
16 namespace gfx { 16 namespace gfx {
17 17
18 // Encapsulates an image that can be bound to a texture, hiding platform 18 // Encapsulates an image that can be bound to a texture, hiding platform
19 // specific management. 19 // specific management.
20 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { 20 class GL_EXPORT GLImage : public base::RefCounted<GLImage> {
21 public: 21 public:
22 GLImage() {} 22 GLImage() {}
23 23
24 // Destroys the image. 24 // Destroys the image.
25 virtual void Destroy(bool have_context) = 0; 25 virtual void Destroy(bool have_context) = 0;
26 26
27 // Get the size of the image. 27 // Get the size of the image.
28 virtual gfx::Size GetSize() = 0; 28 virtual gfx::Size GetSize() = 0;
29 29
30 // Get the image pixel format.
reveman 2015/05/12 15:27:19 Internal format is not guaranteed to match the exa
christiank 2015/05/13 09:02:23 Alright, I was debating whether using GetInternalF
31 virtual unsigned GetFormat() = 0;
reveman 2015/05/12 15:27:19 nit: GetInternalFormat() as that's how we refer to
32
30 // Bind image to texture currently bound to |target|. 33 // Bind image to texture currently bound to |target|.
31 virtual bool BindTexImage(unsigned target) = 0; 34 virtual bool BindTexImage(unsigned target) = 0;
32 35
33 // Release image from texture currently bound to |target|. 36 // Release image from texture currently bound to |target|.
34 virtual void ReleaseTexImage(unsigned target) = 0; 37 virtual void ReleaseTexImage(unsigned target) = 0;
35 38
36 // Copy image to texture currently bound to |target|. 39 // Copy image to texture currently bound to |target|.
37 virtual bool CopyTexImage(unsigned target) = 0; 40 virtual bool CopyTexImage(unsigned target) = 0;
38 41
39 // Called before the texture is used for drawing. 42 // Called before the texture is used for drawing.
(...skipping 20 matching lines...) Expand all
60 63
61 private: 64 private:
62 friend class base::RefCounted<GLImage>; 65 friend class base::RefCounted<GLImage>;
63 66
64 DISALLOW_COPY_AND_ASSIGN(GLImage); 67 DISALLOW_COPY_AND_ASSIGN(GLImage);
65 }; 68 };
66 69
67 } // namespace gfx 70 } // namespace gfx
68 71
69 #endif // UI_GL_GL_IMAGE_H_ 72 #endif // UI_GL_GL_IMAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698