Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp

Issue 1422493003: Change Widget subclasses to use a CullRect instead of an IntRect for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInfo.cpp b/third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp
similarity index 67%
copy from third_party/WebKit/Source/core/paint/PaintInfo.cpp
copy to third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp
index b930437394c1838896126960ea21f7e1f2361083..0ad4b18a9d781f3e8b5273125b521a2084ae1ddb 100644
--- a/third_party/WebKit/Source/core/paint/PaintInfo.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp
@@ -3,31 +3,23 @@
// found in the LICENSE file.
#include "config.h"
-#include "core/paint/PaintInfo.h"
+#include "platform/graphics/paint/CullRect.h"
-namespace blink {
-
-void PaintInfo::updatePaintingRootForChildren(const LayoutObject* layoutObject)
-{
- if (!paintingRoot)
- return;
+#include "platform/geometry/FloatRect.h"
+#include "platform/geometry/LayoutRect.h"
- // If we're the painting root, kids draw normally, and see root of nullptr.
- if (paintingRoot == layoutObject) {
- paintingRoot = nullptr;
- return;
- }
-}
+namespace blink {
-bool PaintInfo::shouldPaintWithinRoot(const LayoutObject* layoutObject) const
+CullRect::CullRect(const CullRect& cullRect, const IntPoint& offset)
{
- return !paintingRoot || paintingRoot == layoutObject;
+ m_rect = cullRect.m_rect;
+ m_rect.moveBy(offset);
}
-CullRect::CullRect(const CullRect& cullRect, const IntPoint& offset)
+CullRect::CullRect(const CullRect& cullRect, const IntSize& offset)
{
m_rect = cullRect.m_rect;
- m_rect.moveBy(offset);
+ m_rect.move(offset);
}
bool CullRect::intersectsCullRect(const IntRect& boundingBox) const
@@ -55,11 +47,6 @@ bool CullRect::intersectsVerticalRange(LayoutUnit lo, LayoutUnit hi) const
return !(lo >= m_rect.maxY() || hi <= m_rect.y());
}
-void PaintInfo::updateCullRect(const AffineTransform& localToParentTransform)
-{
- m_cullRect.updateCullRect(localToParentTransform);
-}
-
void CullRect::updateCullRect(const AffineTransform& localToParentTransform)
{
if (m_rect != LayoutRect::infiniteIntRect())
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/CullRect.h ('k') | third_party/WebKit/Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698