OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "ui/gfx/geometry/point.h" | 14 #include "ui/gfx/geometry/point.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/geometry/rect_f.h" | 16 #include "ui/gfx/geometry/rect_f.h" |
17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
18 #include "ui/gfx/native_widget_types.h" | 18 #include "ui/gfx/native_widget_types.h" |
19 #include "ui/gfx/overlay_transform.h" | 19 #include "ui/gfx/overlay_transform.h" |
20 #include "ui/gl/gl_export.h" | 20 #include "ui/gl/gl_export.h" |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 namespace trace_event { | 23 namespace trace_event { |
24 class ProcessMemoryDump; | 24 class ProcessMemoryDump; |
25 } | 25 } |
26 } | 26 } |
27 | 27 |
| 28 namespace gfx { |
| 29 class Transform; |
| 30 } |
| 31 |
28 namespace gl { | 32 namespace gl { |
29 | 33 |
30 // Encapsulates an image that can be bound and/or copied to a texture, hiding | 34 // Encapsulates an image that can be bound and/or copied to a texture, hiding |
31 // platform specific management. | 35 // platform specific management. |
32 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 36 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
33 public: | 37 public: |
34 GLImage() {} | 38 GLImage() {} |
35 | 39 |
36 // Destroys the image. | 40 // Destroys the image. |
37 virtual void Destroy(bool have_context) = 0; | 41 virtual void Destroy(bool have_context) = 0; |
(...skipping 29 matching lines...) Expand all Loading... |
67 gfx::OverlayTransform transform, | 71 gfx::OverlayTransform transform, |
68 const gfx::Rect& bounds_rect, | 72 const gfx::Rect& bounds_rect, |
69 const gfx::RectF& crop_rect) = 0; | 73 const gfx::RectF& crop_rect) = 0; |
70 | 74 |
71 // Dumps information about the memory backing the GLImage to a dump named | 75 // Dumps information about the memory backing the GLImage to a dump named |
72 // |dump_name|. | 76 // |dump_name|. |
73 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, | 77 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
74 uint64_t process_tracing_id, | 78 uint64_t process_tracing_id, |
75 const std::string& dump_name) = 0; | 79 const std::string& dump_name) = 0; |
76 | 80 |
| 81 // Get the matrix |
| 82 // Copy a custom matrix for this image into |matrix|. |matrixId| describes |
| 83 // the matrix in question. Returns true if |matrix| is filled in, false |
| 84 // if this GLImage doesn't support the custom matrix. |matrix| is unmodified |
| 85 // in that case. |
| 86 virtual bool GetCustomMatrix(int matrixId, float matrix[16]); |
| 87 |
77 protected: | 88 protected: |
78 virtual ~GLImage() {} | 89 virtual ~GLImage() {} |
79 | 90 |
80 private: | 91 private: |
81 friend class base::RefCounted<GLImage>; | 92 friend class base::RefCounted<GLImage>; |
82 | 93 |
83 DISALLOW_COPY_AND_ASSIGN(GLImage); | 94 DISALLOW_COPY_AND_ASSIGN(GLImage); |
84 }; | 95 }; |
85 | 96 |
86 } // namespace gl | 97 } // namespace gl |
87 | 98 |
88 #endif // UI_GL_GL_IMAGE_H_ | 99 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |