| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/rendering/PaintInvalidationState.h" | 6 #include "core/rendering/PaintInvalidationState.h" |
| 7 | 7 |
| 8 #include "core/rendering/RenderInline.h" | 8 #include "core/rendering/RenderInline.h" |
| 9 #include "core/rendering/RenderLayer.h" | 9 #include "core/rendering/RenderLayer.h" |
| 10 #include "core/rendering/RenderView.h" | 10 #include "core/rendering/RenderView.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. | 81 // FIXME: <http://bugs.webkit.org/show_bug.cgi?id=13443> Apply control clip
if present. |
| 82 } | 82 } |
| 83 | 83 |
| 84 void PaintInvalidationState::applyClipIfNeeded(const RenderObject& renderer) | 84 void PaintInvalidationState::applyClipIfNeeded(const RenderObject& renderer) |
| 85 { | 85 { |
| 86 if (!renderer.hasOverflowClip()) | 86 if (!renderer.hasOverflowClip()) |
| 87 return; | 87 return; |
| 88 | 88 |
| 89 const RenderBox& box = toRenderBox(renderer); | 89 const RenderBox& box = toRenderBox(renderer); |
| 90 m_paintOffset -= box.scrolledContentOffset(); |
| 91 |
| 92 // Do not clip scroll layer contents because the compositor expects the whol
e layer |
| 93 // to be always invalidated in-time. |
| 94 if (box.usesCompositedScrolling()) { |
| 95 ASSERT(!m_clipped); // The box should establish paint invalidation conta
iner, so no m_clipped inherited. |
| 96 return; |
| 97 } |
| 98 |
| 90 LayoutRect clipRect(toPoint(m_paintOffset), box.layer()->size()); | 99 LayoutRect clipRect(toPoint(m_paintOffset), box.layer()->size()); |
| 91 if (m_clipped) { | 100 if (m_clipped) { |
| 92 m_clipRect.intersect(clipRect); | 101 m_clipRect.intersect(clipRect); |
| 93 } else { | 102 } else { |
| 94 m_clipRect = clipRect; | 103 m_clipRect = clipRect; |
| 95 m_clipped = true; | 104 m_clipped = true; |
| 96 } | 105 } |
| 97 m_paintOffset -= box.scrolledContentOffset(); | |
| 98 } | 106 } |
| 99 | 107 |
| 100 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |