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

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

Issue 2323403003: Don't un-flip if we're only mapping for one object. (Closed)
Patch Set: Created 4 years, 3 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (m_paintInvalidationContainer->layer()->groupedMapping()) 406 if (m_paintInvalidationContainer->layer()->groupedMapping())
407 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect); 407 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*m_paintInvalid ationContainer, rect);
408 return rect; 408 return rect;
409 } 409 }
410 410
411 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect) 411 static void slowMapToVisualRectInAncestorSpace(const LayoutObject& object, const LayoutBoxModelObject& ancestor, LayoutRect& rect)
412 { 412 {
413 // TODO(wkorman): The flip below is required because visual rects are 413 // TODO(wkorman): The flip below is required because visual rects are
414 // currently in "physical coordinates with flipped block-flow direction" 414 // currently in "physical coordinates with flipped block-flow direction"
415 // (see LayoutBoxModelObject.h) but we need them to be in physical 415 // (see LayoutBoxModelObject.h) but we need them to be in physical
416 // coordinates. 416 // coordinates. When we're mapping within exactly one object we keep the
417 if (object.isBox()) 417 // input rect flipped because we'd just have to re-flip in short order, as
418 // the output of this method must be in the "physical coordinates with
419 // flipped block-flow direction.
420 if (object.isBox() && object != ancestor)
418 toLayoutBox(&object)->flipForWritingMode(rect); 421 toLayoutBox(&object)->flipForWritingMode(rect);
419 422
420 if (object.isLayoutView()) 423 if (object.isLayoutView())
421 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags); 424 toLayoutView(object).mapToVisualRectInAncestorSpace(&ancestor, rect, Inp utIsInFrameCoordinates, DefaultVisualRectFlags);
422 else 425 else
423 object.mapToVisualRectInAncestorSpace(&ancestor, rect); 426 object.mapToVisualRectInAncestorSpace(&ancestor, rect);
424 } 427 }
425 428
426 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const 429 void PaintInvalidationState::mapLocalRectToPaintInvalidationContainer(LayoutRect & rect) const
427 { 430 {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 } 542 }
540 543
541 544
542 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const 545 void PaintInvalidatorContextAdapter::mapLocalRectToPaintInvalidationBacking(cons t LayoutObject& object, LayoutRect& rect) const
543 { 546 {
544 DCHECK(&object == &m_paintInvalidationState.currentObject()); 547 DCHECK(&object == &m_paintInvalidationState.currentObject());
545 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect); 548 m_paintInvalidationState.mapLocalRectToPaintInvalidationBacking(rect);
546 } 549 }
547 550
548 } // namespace blink 551 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/paint/invalidation/document-flipped-blocks-writing-mode-scroll-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698