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

Side by Side Diff: Source/core/paint/LayerPainter.cpp

Issue 1011703005: [Slimming Paint] Allow 3D transforms of different types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: debug strings Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/paint/Transform3DRecorder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/paint/LayerPainter.h" 6 #include "core/paint/LayerPainter.h"
7 7
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/ClipPathOperation.h" 9 #include "core/layout/ClipPathOperation.h"
10 #include "core/layout/FilterEffectRenderer.h" 10 #include "core/layout/FilterEffectRenderer.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 // This involves subtracting out the position of the layer in our current co ordinate space, but preserving 388 // This involves subtracting out the position of the layer in our current co ordinate space, but preserving
389 // the accumulated error for sub-pixel layout. 389 // the accumulated error for sub-pixel layout.
390 LayoutPoint delta; 390 LayoutPoint delta;
391 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, delta); 391 m_renderLayer.convertToLayerCoords(paintingInfo.rootLayer, delta);
392 delta.moveBy(fragmentTranslation); 392 delta.moveBy(fragmentTranslation);
393 TransformationMatrix transform(m_renderLayer.renderableTransform(paintingInf o.paintBehavior)); 393 TransformationMatrix transform(m_renderLayer.renderableTransform(paintingInf o.paintBehavior));
394 IntPoint roundedDelta = roundedIntPoint(delta); 394 IntPoint roundedDelta = roundedIntPoint(delta);
395 transform.translateRight(roundedDelta.x(), roundedDelta.y()); 395 transform.translateRight(roundedDelta.x(), roundedDelta.y());
396 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation + (delta - roundedDelta); 396 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation + (delta - roundedDelta);
397 397
398 Transform3DRecorder transform3DRecorder(*context, m_renderLayer.layoutObject ()->displayItemClient(), transform); 398 Transform3DRecorder transform3DRecorder(*context, m_renderLayer.layoutObject ()->displayItemClient(), DisplayItem::Transform3DElementTransform, transform);
399 399
400 // Now do a paint with the root layer shifted to be us. 400 // Now do a paint with the root layer shifted to be us.
401 LayerPaintingInfo transformedPaintingInfo(&m_renderLayer, LayoutRect(enclosi ngIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), paintingIn fo.paintBehavior, 401 LayerPaintingInfo transformedPaintingInfo(&m_renderLayer, LayoutRect(enclosi ngIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), paintingIn fo.paintBehavior,
402 adjustedSubPixelAccumulation, paintingInfo.paintingRoot); 402 adjustedSubPixelAccumulation, paintingInfo.paintingRoot);
403 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags , ForceSingleFragment); 403 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags , ForceSingleFragment);
404 } 404 }
405 405
406 void LayerPainter::paintChildren(unsigned childrenToVisit, GraphicsContext* cont ext, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) 406 void LayerPainter::paintChildren(unsigned childrenToVisit, GraphicsContext* cont ext, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
407 { 407 {
408 if (!m_renderLayer.hasSelfPaintingLayerDescendant()) 408 if (!m_renderLayer.hasSelfPaintingLayerDescendant())
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 else 579 else
580 m_renderLayer.clearTransform(); 580 m_renderLayer.clearTransform();
581 } else { 581 } else {
582 // Adjust the transform such that the renderer's upper left corn er will paint at (0,0) in user space. 582 // Adjust the transform such that the renderer's upper left corn er will paint at (0,0) in user space.
583 // This involves subtracting out the position of the layer in ou r current coordinate space. 583 // This involves subtracting out the position of the layer in ou r current coordinate space.
584 LayoutPoint childOffset; 584 LayoutPoint childOffset;
585 columnLayers[colIndex - 1]->convertToLayerCoords(paintingInfo.ro otLayer, childOffset); 585 columnLayers[colIndex - 1]->convertToLayerCoords(paintingInfo.ro otLayer, childOffset);
586 TransformationMatrix transform; 586 TransformationMatrix transform;
587 transform.translateRight(roundToInt(childOffset.x() + offset.wid th()), roundToInt(childOffset.y() + offset.height())); 587 transform.translateRight(roundToInt(childOffset.x() + offset.wid th()), roundToInt(childOffset.y() + offset.height()));
588 588
589 Transform3DRecorder transform3DRecorder(*context, m_renderLayer. layoutObject()->displayItemClient(), transform); 589 Transform3DRecorder transform3DRecorder(*context, m_renderLayer. layoutObject()->displayItemClient(), DisplayItem::Transform3DElementTransform, t ransform);
chrishtr 2015/03/17 19:59:14 Is this the same type as the other call site?
jbroman 2015/03/17 20:16:56 Yes, it is.
590 590
591 // Now do a paint with the root layer shifted to be the next mul ticol block. 591 // Now do a paint with the root layer shifted to be the next mul ticol block.
592 LayerPaintingInfo columnPaintingInfo(paintingInfo); 592 LayerPaintingInfo columnPaintingInfo(paintingInfo);
593 columnPaintingInfo.rootLayer = columnLayers[colIndex - 1]; 593 columnPaintingInfo.rootLayer = columnLayers[colIndex - 1];
594 columnPaintingInfo.paintDirtyRect = transform.inverse().mapRect( localDirtyRect); 594 columnPaintingInfo.paintDirtyRect = transform.inverse().mapRect( localDirtyRect);
595 paintChildLayerIntoColumns(context, columnPaintingInfo, paintFla gs, columnLayers, colIndex - 1); 595 paintChildLayerIntoColumns(context, columnPaintingInfo, paintFla gs, columnLayers, colIndex - 1);
596 } 596 }
597 } 597 }
598 598
599 // Move to the next position. 599 // Move to the next position.
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 if (!m_renderLayer.containsDirtyOverlayScrollbars()) 709 if (!m_renderLayer.containsDirtyOverlayScrollbars())
710 return; 710 return;
711 711
712 LayerPaintingInfo paintingInfo(&m_renderLayer, LayoutRect(enclosingIntRect(d amageRect)), paintBehavior, LayoutSize(), paintingRoot); 712 LayerPaintingInfo paintingInfo(&m_renderLayer, LayoutRect(enclosingIntRect(d amageRect)), paintBehavior, LayoutSize(), paintingRoot);
713 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 713 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
714 714
715 m_renderLayer.setContainsDirtyOverlayScrollbars(false); 715 m_renderLayer.setContainsDirtyOverlayScrollbars(false);
716 } 716 }
717 717
718 } // namespace blink 718 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/paint/Transform3DRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698