Bug 1013784 - Implement ClearRect for BasicCompositor. r=Cwiiis
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 22 May 2014 14:36:26 +1200
changeset 184315 fc8ba992b5b06bd439ca214b2fbc07935a698283
parent 184314 91d280c835b2267757761c7a81f4725d7e9b45be
child 184316 f75676ac4f7d70e8fa95ad62340fcf988dd4db2e
push id43800
push usermwoodrow@mozilla.com
push dateThu, 22 May 2014 02:36:43 +0000
treeherdermozilla-inbound@fc8ba992b5b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis
bugs1013784
milestone32.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 1013784 - Implement ClearRect for BasicCompositor. r=Cwiiis
gfx/layers/Compositor.h
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/basic/BasicCompositor.h
--- a/gfx/layers/Compositor.h
+++ b/gfx/layers/Compositor.h
@@ -306,17 +306,17 @@ public:
    */
   virtual void DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect,
                         const EffectChain& aEffectChain,
                         gfx::Float aOpacity, const gfx::Matrix4x4 &aTransform) = 0;
 
   /*
    * Clear aRect on current render target.
    */
-  virtual void ClearRect(const gfx::Rect& aRect) { }
+  virtual void ClearRect(const gfx::Rect& aRect) = 0;
 
   /**
    * Start a new frame.
    *
    * aInvalidRect is the invalid region of the screen; it can be ignored for
    * compositors where the performance for compositing the entire window is
    * sufficient.
    *
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -369,16 +369,22 @@ BasicCompositor::DrawQuad(const gfx::Rec
 
     buffer->DrawSurface(temp, transformBounds, transformBounds);
   }
 
   buffer->PopClip();
 }
 
 void
+BasicCompositor::ClearRect(const gfx::Rect& aRect)
+{
+  mRenderTarget->mDrawTarget->ClearRect(aRect);
+}
+
+void
 BasicCompositor::BeginFrame(const nsIntRegion& aInvalidRegion,
                             const gfx::Rect *aClipRectIn,
                             const gfx::Matrix& aTransform,
                             const gfx::Rect& aRenderBounds,
                             gfx::Rect *aClipRectOut /* = nullptr */,
                             gfx::Rect *aRenderBoundsOut /* = nullptr */)
 {
   nsIntRect intRect;
--- a/gfx/layers/basic/BasicCompositor.h
+++ b/gfx/layers/basic/BasicCompositor.h
@@ -79,16 +79,18 @@ public:
   }
 
   virtual void DrawQuad(const gfx::Rect& aRect,
                         const gfx::Rect& aClipRect,
                         const EffectChain &aEffectChain,
                         gfx::Float aOpacity,
                         const gfx::Matrix4x4 &aTransform) MOZ_OVERRIDE;
 
+  virtual void ClearRect(const gfx::Rect& aRect) MOZ_OVERRIDE;
+
   virtual void BeginFrame(const nsIntRegion& aInvalidRegion,
                           const gfx::Rect *aClipRectIn,
                           const gfx::Matrix& aTransform,
                           const gfx::Rect& aRenderBounds,
                           gfx::Rect *aClipRectOut = nullptr,
                           gfx::Rect *aRenderBoundsOut = nullptr) MOZ_OVERRIDE;
   virtual void EndFrame() MOZ_OVERRIDE;
   virtual void EndFrameForExternalComposition(const gfx::Matrix& aTransform) MOZ_OVERRIDE