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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "ui/gfx/geometry/point.h" | 9 #include "ui/gfx/geometry/point.h" |
10 #include "ui/gfx/geometry/rect.h" | 10 #include "ui/gfx/geometry/rect.h" |
11 #include "ui/gfx/geometry/rect_f.h" | 11 #include "ui/gfx/geometry/rect_f.h" |
12 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/overlay_transform.h" | 14 #include "ui/gfx/overlay_transform.h" |
15 #include "ui/gl/gl_export.h" | 15 #include "ui/gl/gl_export.h" |
16 | 16 |
| 17 namespace base { |
| 18 namespace trace_event { |
| 19 class ProcessMemoryDump; |
| 20 } |
| 21 } |
| 22 |
17 namespace gfx { | 23 namespace gfx { |
18 | 24 |
19 // Encapsulates an image that can be bound to a texture, hiding platform | 25 // Encapsulates an image that can be bound to a texture, hiding platform |
20 // specific management. | 26 // specific management. |
21 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 27 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
22 public: | 28 public: |
23 GLImage() {} | 29 GLImage() {} |
24 | 30 |
25 // Destroys the image. | 31 // Destroys the image. |
26 virtual void Destroy(bool have_context) = 0; | 32 virtual void Destroy(bool have_context) = 0; |
(...skipping 27 matching lines...) Expand all Loading... |
54 // Called after the texture image data has been modified. | 60 // Called after the texture image data has been modified. |
55 virtual void DidModifyTexImage() = 0; | 61 virtual void DidModifyTexImage() = 0; |
56 | 62 |
57 // Schedule image as an overlay plane to be shown at swap time for |widget|. | 63 // Schedule image as an overlay plane to be shown at swap time for |widget|. |
58 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, | 64 virtual bool ScheduleOverlayPlane(gfx::AcceleratedWidget widget, |
59 int z_order, | 65 int z_order, |
60 OverlayTransform transform, | 66 OverlayTransform transform, |
61 const Rect& bounds_rect, | 67 const Rect& bounds_rect, |
62 const RectF& crop_rect) = 0; | 68 const RectF& crop_rect) = 0; |
63 | 69 |
| 70 // Dumps information about the memory backing the GLImage to a dump named |
| 71 // |dump_name|. |
| 72 virtual void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, |
| 73 uint64_t process_tracing_id, |
| 74 const std::string& dump_name) = 0; |
| 75 |
64 protected: | 76 protected: |
65 virtual ~GLImage() {} | 77 virtual ~GLImage() {} |
66 | 78 |
67 private: | 79 private: |
68 friend class base::RefCounted<GLImage>; | 80 friend class base::RefCounted<GLImage>; |
69 | 81 |
70 DISALLOW_COPY_AND_ASSIGN(GLImage); | 82 DISALLOW_COPY_AND_ASSIGN(GLImage); |
71 }; | 83 }; |
72 | 84 |
73 } // namespace gfx | 85 } // namespace gfx |
74 | 86 |
75 #endif // UI_GL_GL_IMAGE_H_ | 87 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |