Chromium Code Reviews| 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, | |
|
apatrick_chromium
2011/12/05 22:42:45
nit: const gfx::Rect&
jonathan.backer
2011/12/06 18:29:31
Done.
| |
| 87 int x, int y, | |
| 88 int width, int height); | |
| 86 | 89 |
| 87 // Notifies the container that its surface is invalid. | 90 // Notifies the container that its surface is invalid. |
| 88 void set_surface_invalid() { was_painted_to_ = false; } | 91 void set_surface_invalid() { was_painted_to_ = false; } |
| 89 private: | 92 private: |
| 90 // The manager of this accelerated surface container. | 93 // The manager of this accelerated surface container. |
| 91 AcceleratedSurfaceContainerManagerMac* manager_; | 94 AcceleratedSurfaceContainerManagerMac* manager_; |
| 92 | 95 |
| 93 // Whether this accelerated surface's content is supposed to be opaque. | 96 // Whether this accelerated surface's content is supposed to be opaque. |
| 94 bool opaque_; | 97 bool opaque_; |
| 95 | 98 |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 122 // The "live" OpenGL texture referring to this IOSurfaceRef. Note | 125 // The "live" OpenGL texture referring to this IOSurfaceRef. Note |
| 123 // that per the CGLTexImageIOSurface2D API we do not need to | 126 // that per the CGLTexImageIOSurface2D API we do not need to |
| 124 // explicitly update this texture's contents once created. All we | 127 // explicitly update this texture's contents once created. All we |
| 125 // need to do is ensure it is re-bound before attempting to draw | 128 // need to do is ensure it is re-bound before attempting to draw |
| 126 // with it. | 129 // with it. |
| 127 GLuint texture_; | 130 GLuint texture_; |
| 128 | 131 |
| 129 // True if we need to upload the texture again during the next draw. | 132 // True if we need to upload the texture again during the next draw. |
| 130 bool texture_needs_upload_; | 133 bool texture_needs_upload_; |
| 131 | 134 |
| 135 // The region that was updated via a partial update. |update_rect_.IsEmpty()| | |
| 136 // indicates that the whole region was updated. | |
| 137 gfx::Rect update_rect_; | |
| 138 | |
| 132 // This may refer to an old version of the texture if the container is | 139 // This may refer to an old version of the texture if the container is |
| 133 // resized, for example. | 140 // resized, for example. |
| 134 GLuint texture_pending_deletion_; | 141 GLuint texture_pending_deletion_; |
| 135 | 142 |
| 136 // Stores if the plugin has a visible state. | 143 // Stores if the plugin has a visible state. |
| 137 bool visible_; | 144 bool visible_; |
| 138 | 145 |
| 139 // Stores if the plugin's IOSurface has been swapped before. Used to not show | 146 // 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. | 147 // it before it hasn't been painted to at least once. |
| 141 bool was_painted_to_; | 148 bool was_painted_to_; |
| 142 | 149 |
| 143 // Releases the IOSurface reference, if any, retained by this object. | 150 // Releases the IOSurface reference, if any, retained by this object. |
| 144 void ReleaseIOSurface(); | 151 void ReleaseIOSurface(); |
| 145 | 152 |
| 146 // Enqueue our texture for later deletion. | 153 // Enqueue our texture for later deletion. |
| 147 void EnqueueTextureForDeletion(); | 154 void EnqueueTextureForDeletion(); |
| 148 | 155 |
| 156 void set_was_painted_to_common(uint64 surface_id); | |
| 157 | |
| 149 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); | 158 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); |
| 150 }; | 159 }; |
| 151 | 160 |
| 152 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ | 161 #endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_SURFACE_CONTAINER_MAC_H_ |
| OLD | NEW |