Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1122)

Unified Diff: chrome/browser/renderer_host/accelerated_surface_container_mac.h

Issue 3125033: Mac: Re-fix hidden CoreAnimation plugins. (Closed)
Patch Set: real fix Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698