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

Side by Side Diff: third_party/WebKit/Source/core/layout/PaintInvalidationState.cpp

Issue 2073563002: Rework mapToVisualRectInAncestorSpace to handle flipped blocks correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
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 "core/layout/PaintInvalidationState.h" 5 #include "core/layout/PaintInvalidationState.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 rect = SVGLayoutSupport::clippedOverflowRectForPaintInvalidation(m_curre ntObject, *m_paintInvalidationContainer); 382 rect = SVGLayoutSupport::clippedOverflowRectForPaintInvalidation(m_curre ntObject, *m_paintInvalidationContainer);
383 } 383 }
384 384
385 if (m_paintInvalidationContainer->layer()->groupedMapping()) 385 if (m_paintInvalidationContainer->layer()->groupedMapping())
386 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect); 386 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect);
387 return rect; 387 return rect;
388 } 388 }
389 389
390 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) 390 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect)
391 { 391 {
392 // TODO(wkorman): The flip below is required because visual rects are
393 // currently in "physical coordinates with flipped block-flow direction"
394 // (see LayoutBoxModelObject.h) but we need them to be in physical
395 // coordinates.
396 if (object.isBox())
397 toLayoutBox(&object)->flipForWritingMode(rect);
398
392 if (object.isLayoutView()) 399 if (object.isLayoutView())
393 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags); 400 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags);
394 else 401 else
395 object.mapToVisualRectInAncestorSpace(&ancestor, rect); 402 object.mapToVisualRectInAncestorSpace(&ancestor, rect);
396 } 403 }
397 404
398 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const 405 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const
399 { 406 {
400 ASSERT(!m_didUpdateForChildren); 407 ASSERT(!m_didUpdateForChildren);
401 408
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 WTFLogAlways("Fast path paint invalidation rect differs from slow path: fast : %s vs slow: %s", 494 WTFLogAlways("Fast path paint invalidation rect differs from slow path: fast : %s vs slow: %s",
488 fastPathRect.toString().ascii().data(), slowPathRect.toString().ascii(). data()); 495 fastPathRect.toString().ascii().data(), slowPathRect.toString().ascii(). data());
489 showLayoutTree(&m_currentObject); 496 showLayoutTree(&m_currentObject);
490 497
491 ASSERT_NOT_REACHED(); 498 ASSERT_NOT_REACHED();
492 } 499 }
493 500
494 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY 501 #endif // CHECK_FAST_PATH_SLOW_PATH_EQUALITY
495 502
496 } // namespace blink 503 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | third_party/WebKit/Source/core/layout/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698