Bug 1066280 - Handle dirtying in BasicCanvasLayer. - r=mattwoodrow
authorjdashg <jdashg+github@gmail.com>
Wed, 08 Oct 2014 15:18:28 -0700
changeset 209895 216915390f9b50a2d1520a41bc9ff5b150c4ded2
parent 209894 a3bc505ee94570005f01b41bed8082369bdbe7e6
child 209896 d0617afd919996c6592d22121526f27ead09efce
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersmattwoodrow
bugs1066280
milestone35.0a1
Bug 1066280 - Handle dirtying in BasicCanvasLayer. - r=mattwoodrow
gfx/layers/basic/BasicCanvasLayer.cpp
--- a/gfx/layers/basic/BasicCanvasLayer.cpp
+++ b/gfx/layers/basic/BasicCanvasLayer.cpp
@@ -23,19 +23,23 @@ namespace layers {
 void
 BasicCanvasLayer::Paint(DrawTarget* aDT,
                         const Point& aDeviceOffset,
                         Layer* aMaskLayer)
 {
   if (IsHidden())
     return;
 
-  FirePreTransactionCallback();
-  UpdateTarget();
-  FireDidTransactionCallback();
+  if (IsDirty()) {
+    Painted();
+
+    FirePreTransactionCallback();
+    UpdateTarget();
+    FireDidTransactionCallback();
+  }
 
   if (!mSurface) {
     return;
   }
 
   Matrix oldTM;
   if (mNeedsYFlip) {
     oldTM = aDT->GetTransform();