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

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

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