OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // The "GPU plugin" is currently implemented as a special kind of | 9 // The "GPU plugin" is currently implemented as a special kind of |
10 // NPAPI plugin to provide high-performance on-screen 3D rendering for | 10 // NPAPI plugin to provide high-performance on-screen 3D rendering for |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 76 |
77 // Causes the next Draw call to trigger a texture upload. Should be called any | 77 // Causes the next Draw call to trigger a texture upload. Should be called any |
78 // time the drawing context has changed. | 78 // time the drawing context has changed. |
79 void ForceTextureReload() { texture_needs_upload_ = true; } | 79 void ForceTextureReload() { texture_needs_upload_ = true; } |
80 | 80 |
81 // Returns if the surface should be shown. | 81 // Returns if the surface should be shown. |
82 bool ShouldBeVisible() const; | 82 bool ShouldBeVisible() const; |
83 | 83 |
84 // Notifies the the container that its surface was painted to. | 84 // Notifies the the container that its surface was painted to. |
85 void set_was_painted_to(uint64 surface_id); | 85 void set_was_painted_to(uint64 surface_id); |
86 void set_was_painted_to(uint64 surface_id, | |
87 const gfx::Rect& update_rect); | |
86 | 88 |
87 // Notifies the container that its surface is invalid. | 89 // Notifies the container that its surface is invalid. |
88 void set_surface_invalid() { was_painted_to_ = false; } | 90 void set_surface_invalid() { was_painted_to_ = false; } |
89 private: | 91 private: |
90 // The manager of this accelerated surface container. | 92 // The manager of this accelerated surface container. |
91 AcceleratedSurfaceContainerManagerMac* manager_; | 93 AcceleratedSurfaceContainerManagerMac* manager_; |
92 | 94 |
93 // Whether this accelerated surface's content is supposed to be opaque. | 95 // Whether this accelerated surface's content is supposed to be opaque. |
94 bool opaque_; | 96 bool opaque_; |
95 | 97 |
(...skipping 26 matching lines...) Expand all Loading... | |
122 // The "live" OpenGL texture referring to this IOSurfaceRef. Note | 124 // The "live" OpenGL texture referring to this IOSurfaceRef. Note |
123 // that per the CGLTexImageIOSurface2D API we do not need to | 125 // that per the CGLTexImageIOSurface2D API we do not need to |
124 // explicitly update this texture's contents once created. All we | 126 // explicitly update this texture's contents once created. All we |
125 // need to do is ensure it is re-bound before attempting to draw | 127 // need to do is ensure it is re-bound before attempting to draw |
126 // with it. | 128 // with it. |
127 GLuint texture_; | 129 GLuint texture_; |
128 | 130 |
129 // True if we need to upload the texture again during the next draw. | 131 // True if we need to upload the texture again during the next draw. |
130 bool texture_needs_upload_; | 132 bool texture_needs_upload_; |
131 | 133 |
134 // The region that was updated via a partial update. |update_rect_.IsEmpty()| | |
135 // indicates that the whole region was updated. | |
136 gfx::Rect update_rect_; | |
137 | |
132 // This may refer to an old version of the texture if the container is | 138 // This may refer to an old version of the texture if the container is |
133 // resized, for example. | 139 // resized, for example. |
134 GLuint texture_pending_deletion_; | 140 GLuint texture_pending_deletion_; |
135 | 141 |
136 // Stores if the plugin has a visible state. | 142 // Stores if the plugin has a visible state. |
137 bool visible_; | 143 bool visible_; |
138 | 144 |
139 // Stores if the plugin's IOSurface has been swapped before. Used to not show | 145 // Stores if the plugin's IOSurface has been swapped before. Used to not show |
140 // it before it hasn't been painted to at least once. | 146 // it before it hasn't been painted to at least once. |
141 bool was_painted_to_; | 147 bool was_painted_to_; |
142 | 148 |
143 // Releases the IOSurface reference, if any, retained by this object. | 149 // Releases the IOSurface reference, if any, retained by this object. |
144 void ReleaseIOSurface(); | 150 void ReleaseIOSurface(); |
145 | 151 |
146 // Enqueue our texture for later deletion. | 152 // Enqueue our texture for later deletion. |
147 void EnqueueTextureForDeletion(); | 153 void EnqueueTextureForDeletion(); |
148 | 154 |
155 void set_was_painted_to_common(uint64 surface_id); | |
sky
2011/12/06 19:40:39
methods before variables.
jonathan.backer
2011/12/06 20:24:41
Done.
| |
156 | |
149 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); | 157 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); |
150 }; | 158 }; |
151 | 159 |
152 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ | 160 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
OLD | NEW |