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/overlay_transform.h" |
| 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/gfx/rect_f.h" |
9 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
10 #include "ui/gl/gl_export.h" | 13 #include "ui/gl/gl_export.h" |
11 | 14 |
12 namespace gfx { | 15 namespace gfx { |
13 | 16 |
14 // 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 |
15 // specific management. | 18 // specific management. |
16 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { | 19 class GL_EXPORT GLImage : public base::RefCounted<GLImage> { |
17 public: | 20 public: |
18 GLImage(); | 21 GLImage(); |
(...skipping 15 matching lines...) Expand all Loading... |
34 | 37 |
35 // Called after the texture has been used for drawing. | 38 // Called after the texture has been used for drawing. |
36 virtual void DidUseTexImage() = 0; | 39 virtual void DidUseTexImage() = 0; |
37 | 40 |
38 // Called before the texture image data will be modified. | 41 // Called before the texture image data will be modified. |
39 virtual void WillModifyTexImage() = 0; | 42 virtual void WillModifyTexImage() = 0; |
40 | 43 |
41 // Called after the texture image data has been modified. | 44 // Called after the texture image data has been modified. |
42 virtual void DidModifyTexImage() = 0; | 45 virtual void DidModifyTexImage() = 0; |
43 | 46 |
| 47 // Schedule image as an overlay plane to be shown at swap time. |
| 48 // |z_order| specifies the stacking order of the plane relative to the |
| 49 // main framebuffer located at index 0. For the case where there is no |
| 50 // main framebuffer, overlays may be scheduled at 0, taking its place. |
| 51 // |transform| specifies how the buffer is to be transformed during |
| 52 // composition. |
| 53 // |bounds_rect| specify where it is supposed to be on the screen in pixels. |
| 54 // |crop_rect| specifies the region within the buffer to be placed inside |
| 55 // |bounds_rect|. |
| 56 virtual bool ScheduleOverlayPlane(int z_order, |
| 57 OverlayTransform transform, |
| 58 const Rect& bounds_rect, |
| 59 const RectF& crop_rect) = 0; |
| 60 |
44 // Indicate that image should be released after use. | 61 // Indicate that image should be released after use. |
45 // (For an Android work-around only). | 62 // (For an Android work-around only). |
46 virtual void SetReleaseAfterUse(); | 63 virtual void SetReleaseAfterUse(); |
47 | 64 |
48 protected: | 65 protected: |
49 virtual ~GLImage(); | 66 virtual ~GLImage(); |
50 | 67 |
51 private: | 68 private: |
52 friend class base::RefCounted<GLImage>; | 69 friend class base::RefCounted<GLImage>; |
53 | 70 |
54 DISALLOW_COPY_AND_ASSIGN(GLImage); | 71 DISALLOW_COPY_AND_ASSIGN(GLImage); |
55 }; | 72 }; |
56 | 73 |
57 } // namespace gfx | 74 } // namespace gfx |
58 | 75 |
59 #endif // UI_GL_GL_IMAGE_H_ | 76 #endif // UI_GL_GL_IMAGE_H_ |
OLD | NEW |