Bug 695845 - Part 3: Add Flush() and Disconnect() methods to ImageContainer. r=cjones
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 19 Dec 2011 14:49:45 -0500
changeset 84702 d8004eb222525f6ac7f0429d5a898ad3dac02637
parent 84701 86e91202ef5153177d4f38b0b7f174799819ee03
child 84703 76dcfabe0a2ad5bfc94b9c58c02529d6bb250c37
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscjones
bugs695845
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 695845 - Part 3: Add Flush() and Disconnect() methods to ImageContainer. r=cjones
gfx/layers/ImageLayers.h
--- a/gfx/layers/ImageLayers.h
+++ b/gfx/layers/ImageLayers.h
@@ -180,16 +180,30 @@ public:
    * Can be called on any thread. This method takes mReentrantMonitor
    * when accessing thread-shared state.
    * Implementations must call CurrentImageChanged() while holding
    * mReentrantMonitor.
    */
   virtual already_AddRefed<Image> GetCurrentImage() = 0;
 
   /**
+   * Make sure the current image is ready for rendering by this container.
+   * May only be called from the main thread.
+   */
+  virtual void Flush() {}
+
+  /**
+   * |Disconnect()| is used by ImageContainer hooked up over IPC.  It may 
+   * be called at any time, and may not be called at all.  Using an
+   * IPC-enabled layer after Destroy() (drawing etc.) results in a
+   * safe no-op; no crashy or uaf etc.
+   */
+  virtual void Disconnect() {}
+
+  /**
    * Get the current image as a gfxASurface. This is useful for fallback
    * rendering.
    * This can only be called from the main thread, since cairo objects
    * can only be used from the main thread.
    * This is defined here and not on Image because it's possible (likely)
    * that some backends will make an Image "ready to draw" only when it
    * becomes the current image for an image container.
    * Returns null if there is no current image.