Index: chrome/browser/renderer_host/accelerated_surface_container_mac.h |
diff --git a/chrome/browser/renderer_host/accelerated_surface_container_mac.h b/chrome/browser/renderer_host/accelerated_surface_container_mac.h |
index b7a68833b443fa3e6a39545b3a0dcd31a92f141a..b0b605153b111acc1c63879f2997f0b05cdd6009 100644 |
--- a/chrome/browser/renderer_host/accelerated_surface_container_mac.h |
+++ b/chrome/browser/renderer_host/accelerated_surface_container_mac.h |
@@ -75,6 +75,11 @@ class AcceleratedSurfaceContainerMac { |
// time the drawing context has changed. |
void ForceTextureReload() { texture_needs_upload_ = true; } |
+ // Notifies the surface that it was painted to. |
+ void set_was_painted_to() { was_painted_to_ = true; } |
+ |
+ // Returns if the surface should be shown. |
+ bool should_be_visible() const { return visible_ && was_painted_to_; } |
private: |
// The manager of this accelerated surface container. |
AcceleratedSurfaceContainerManagerMac* manager_; |
@@ -114,6 +119,13 @@ class AcceleratedSurfaceContainerMac { |
// resized, for example. |
GLuint texture_pending_deletion_; |
+ // Stores if the plugin has a visible state. |
+ bool visible_; |
+ |
+ // Stores if the plugin's IOSurface has been swapped before. Used to not show |
+ // it before it hasn't been painted to at least once. |
+ bool was_painted_to_; |
+ |
// Releases the IOSurface reference, if any, retained by this object. |
void ReleaseIOSurface(); |