[chromium] Fix minor style nit in CCLayerImpl
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 22:51:12 +0000 (22:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 22:51:12 +0000 (22:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=71070

Patch by Shawn Singh <shawnsingh@chromium.org> on 2011-11-17
Reviewed by James Robinson.

Fixes if-statements on several settors to follow WebKit
conventions. Existing CCLayerImplTest unit tests already cover
this change.

* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::setBounds):
(WebCore::CCLayerImpl::setMaskLayer):
(WebCore::CCLayerImpl::setReplicaLayer):
(WebCore::CCLayerImpl::setDrawsContent):
(WebCore::CCLayerImpl::setAnchorPoint):
(WebCore::CCLayerImpl::setAnchorPointZ):
(WebCore::CCLayerImpl::setBackgroundColor):
(WebCore::CCLayerImpl::setMasksToBounds):
(WebCore::CCLayerImpl::setOpaque):
(WebCore::CCLayerImpl::setOpacity):
(WebCore::CCLayerImpl::setPosition):
(WebCore::CCLayerImpl::setPreserves3D):
(WebCore::CCLayerImpl::setZoomAnimatorTransform):
(WebCore::CCLayerImpl::setSublayerTransform):
(WebCore::CCLayerImpl::setTransform):
(WebCore::CCLayerImpl::setDebugBorderColor):
(WebCore::CCLayerImpl::setDebugBorderWidth):
(WebCore::CCLayerImpl::setContentBounds):
(WebCore::CCLayerImpl::setScrollPosition):
(WebCore::CCLayerImpl::setScrollDelta):
(WebCore::CCLayerImpl::setScaleDelta):
(WebCore::CCLayerImpl::setDoubleSided):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100682 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog [changed mode: 0755->0644]
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

old mode 100755 (executable)
new mode 100644 (file)
index c7972e5..37ecc78
@@ -1,3 +1,38 @@
+2011-11-17  Shawn Singh  <shawnsingh@chromium.org>
+
+        [chromium] Fix minor style nit in CCLayerImpl
+        https://bugs.webkit.org/show_bug.cgi?id=71070
+
+        Reviewed by James Robinson.
+
+        Fixes if-statements on several settors to follow WebKit
+        conventions. Existing CCLayerImplTest unit tests already cover
+        this change.
+
+        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+        (WebCore::CCLayerImpl::setBounds):
+        (WebCore::CCLayerImpl::setMaskLayer):
+        (WebCore::CCLayerImpl::setReplicaLayer):
+        (WebCore::CCLayerImpl::setDrawsContent):
+        (WebCore::CCLayerImpl::setAnchorPoint):
+        (WebCore::CCLayerImpl::setAnchorPointZ):
+        (WebCore::CCLayerImpl::setBackgroundColor):
+        (WebCore::CCLayerImpl::setMasksToBounds):
+        (WebCore::CCLayerImpl::setOpaque):
+        (WebCore::CCLayerImpl::setOpacity):
+        (WebCore::CCLayerImpl::setPosition):
+        (WebCore::CCLayerImpl::setPreserves3D):
+        (WebCore::CCLayerImpl::setZoomAnimatorTransform):
+        (WebCore::CCLayerImpl::setSublayerTransform):
+        (WebCore::CCLayerImpl::setTransform):
+        (WebCore::CCLayerImpl::setDebugBorderColor):
+        (WebCore::CCLayerImpl::setDebugBorderWidth):
+        (WebCore::CCLayerImpl::setContentBounds):
+        (WebCore::CCLayerImpl::setScrollPosition):
+        (WebCore::CCLayerImpl::setScrollDelta):
+        (WebCore::CCLayerImpl::setScaleDelta):
+        (WebCore::CCLayerImpl::setDoubleSided):
+
 2011-11-17  Michael Saboff  <msaboff@apple.com>
 
         Leaks seen in MemoryPressureHandlerMac.mm on Leaks bot
index 1ab2e7e8e67786137a39a871525cbb58b9b30f25..a7f6e836804ab45a59624a370d628325a879fcd1 100644 (file)
@@ -252,184 +252,206 @@ void CCLayerImpl::resetPropertyChangedFlagForSubtree()
 
 void CCLayerImpl::setBounds(const IntSize& bounds)
 {
-    if (m_bounds != bounds) {
-        m_bounds = bounds;
+    if (m_bounds == bounds)
+        return;
 
-        if (masksToBounds())
-            noteLayerPropertyChangedForSubtree();
-        else
-            m_layerPropertyChanged = true;
-    }
+    m_bounds = bounds;
+
+    if (masksToBounds())
+        noteLayerPropertyChangedForSubtree();
+    else
+        m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setMaskLayer(PassRefPtr<CCLayerImpl> maskLayer)
 {
-    if (m_maskLayer != maskLayer) {
-        m_maskLayer = maskLayer;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_maskLayer == maskLayer)
+        return;
+
+    m_maskLayer = maskLayer;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setReplicaLayer(PassRefPtr<CCLayerImpl> replicaLayer)
 {
-    if (m_replicaLayer != replicaLayer) {
-        m_replicaLayer = replicaLayer;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_replicaLayer == replicaLayer)
+        return;
+
+    m_replicaLayer = replicaLayer;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setDrawsContent(bool drawsContent)
 {
-    if (m_drawsContent != drawsContent) {
-        m_drawsContent = drawsContent;
-        m_layerPropertyChanged = true;
-    }
+    if (m_drawsContent == drawsContent)
+        return;
+
+    m_drawsContent = drawsContent;
+    m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setAnchorPoint(const FloatPoint& anchorPoint)
 {
-    if (m_anchorPoint != anchorPoint) {
-        m_anchorPoint = anchorPoint;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_anchorPoint == anchorPoint)
+        return;
+
+    m_anchorPoint = anchorPoint;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setAnchorPointZ(float anchorPointZ)
 {
-    if (m_anchorPointZ != anchorPointZ) {
-        m_anchorPointZ = anchorPointZ;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_anchorPointZ == anchorPointZ)
+        return;
+
+    m_anchorPointZ = anchorPointZ;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setBackgroundColor(const Color& backgroundColor)
 {
-    if (m_backgroundColor != backgroundColor) {
-        m_backgroundColor = backgroundColor;
-        m_layerPropertyChanged = true;
-    }
+    if (m_backgroundColor == backgroundColor)
+        return;
+
+    m_backgroundColor = backgroundColor;
+    m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setMasksToBounds(bool masksToBounds)
 {
-    if (m_masksToBounds != masksToBounds) {
-        m_masksToBounds = masksToBounds;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_masksToBounds == masksToBounds)
+        return;
+
+    m_masksToBounds = masksToBounds;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setOpaque(bool opaque)
 {
-    if (m_opaque != opaque) {
-        m_opaque = opaque;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_opaque == opaque)
+        return;
+
+    m_opaque = opaque;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setOpacity(float opacity)
 {
-    if (m_opacity != opacity) {
-        m_opacity = opacity;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_opacity == opacity)
+        return;
+
+    m_opacity = opacity;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setPosition(const FloatPoint& position)
 {
-    if (m_position != position) {
-        m_position = position;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_position == position)
+        return;
+
+    m_position = position;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setPreserves3D(bool preserves3D)
 {
-    if (m_preserves3D != preserves3D) {
-        m_preserves3D = preserves3D;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_preserves3D == preserves3D)
+        return;
+
+    m_preserves3D = preserves3D;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setZoomAnimatorTransform(const TransformationMatrix& zoomAnimatorTransform)
 {
-    if (m_zoomAnimatorTransform != zoomAnimatorTransform) {
-        m_zoomAnimatorTransform = zoomAnimatorTransform;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_zoomAnimatorTransform == zoomAnimatorTransform)
+        return;
+
+    m_zoomAnimatorTransform = zoomAnimatorTransform;
+    noteLayerPropertyChangedForSubtree();
 }
 
 
 void CCLayerImpl::setSublayerTransform(const TransformationMatrix& sublayerTransform)
 {
-    if (m_sublayerTransform != sublayerTransform) {
-        m_sublayerTransform = sublayerTransform;
-        // sublayer transform does not affect the current layer; it affects only its children.
-        noteLayerPropertyChangedForDescendants();
-    }
+    if (m_sublayerTransform == sublayerTransform)
+        return;
+
+    m_sublayerTransform = sublayerTransform;
+    // sublayer transform does not affect the current layer; it affects only its children.
+    noteLayerPropertyChangedForDescendants();
 }
 
 void CCLayerImpl::setTransform(const TransformationMatrix& transform)
 {
-    if (m_transform != transform) {
-        m_transform = transform;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_transform == transform)
+        return;
+
+    m_transform = transform;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setDebugBorderColor(Color debugBorderColor)
 {
-    if (m_debugBorderColor != debugBorderColor) {
-        m_debugBorderColor = debugBorderColor;
-        m_layerPropertyChanged = true;
-    }
+    if (m_debugBorderColor == debugBorderColor)
+        return;
+
+    m_debugBorderColor = debugBorderColor;
+    m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setDebugBorderWidth(float debugBorderWidth)
 {
-    if (m_debugBorderWidth != debugBorderWidth) {
-        m_debugBorderWidth = debugBorderWidth;
-        m_layerPropertyChanged = true;
-    }
+    if (m_debugBorderWidth == debugBorderWidth)
+        return;
+
+    m_debugBorderWidth = debugBorderWidth;
+    m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setContentBounds(const IntSize& contentBounds)
 {
-    if (m_contentBounds != contentBounds) {
-        m_contentBounds = contentBounds;
-        m_layerPropertyChanged = true;
-    }
+    if (m_contentBounds == contentBounds)
+        return;
+
+    m_contentBounds = contentBounds;
+    m_layerPropertyChanged = true;
 }
 
 void CCLayerImpl::setScrollPosition(const IntPoint& scrollPosition)
 {
-    if (m_scrollPosition != scrollPosition) {
-        m_scrollPosition = scrollPosition;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_scrollPosition == scrollPosition)
+        return;
+
+    m_scrollPosition = scrollPosition;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setScrollDelta(const IntSize& scrollDelta)
 {
-    if (m_scrollDelta != scrollDelta) {
-        m_scrollDelta = scrollDelta;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_scrollDelta == scrollDelta)
+        return;
+
+    m_scrollDelta = scrollDelta;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setPageScaleDelta(float pageScaleDelta)
 {
-    if (m_pageScaleDelta != pageScaleDelta) {
-        m_pageScaleDelta = pageScaleDelta;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_pageScaleDelta == pageScaleDelta)
+        return;
+
+    m_pageScaleDelta = pageScaleDelta;
+    noteLayerPropertyChangedForSubtree();
 }
 
 void CCLayerImpl::setDoubleSided(bool doubleSided)
 {
-    if (m_doubleSided != doubleSided) {
-        m_doubleSided = doubleSided;
-        noteLayerPropertyChangedForSubtree();
-    }
+    if (m_doubleSided == doubleSided)
+        return;
+
+    m_doubleSided = doubleSided;
+    noteLayerPropertyChangedForSubtree();
 }
 
 }