| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "platform/graphics/compositing/PaintArtifactCompositor.h" | 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
| 6 | 6 |
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 10 #include "cc/playback/compositing_display_item.h" | 10 #include "cc/playback/compositing_display_item.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 const TransformationMatrix& localToAncestorMatrix = | 275 const TransformationMatrix& localToAncestorMatrix = |
| 276 geometryMapper.localToAncestorMatrix(transformNode, | 276 geometryMapper.localToAncestorMatrix(transformNode, |
| 277 ancestorState.transform()); | 277 ancestorState.transform()); |
| 278 // Clips are only in descendant spaces that are transformed by one | 278 // Clips are only in descendant spaces that are transformed by one |
| 279 // or more scrolls. | 279 // or more scrolls. |
| 280 DCHECK(localToAncestorMatrix.isIdentityOrTranslation()); | 280 DCHECK(localToAncestorMatrix.isIdentityOrTranslation()); |
| 281 } | 281 } |
| 282 #endif | 282 #endif |
| 283 | 283 |
| 284 FloatRect combinedClip = | 284 FloatRect combinedClip = |
| 285 geometryMapper.localToAncestorClipRect(localState, ancestorState); | 285 geometryMapper.localToAncestorClipRect(localState, ancestorState).rect(); |
| 286 | 286 |
| 287 ccList.CreateAndAppendPairedBeginItem<cc::FloatClipDisplayItem>( | 287 ccList.CreateAndAppendPairedBeginItem<cc::FloatClipDisplayItem>( |
| 288 gfx::RectF(combinedClip)); | 288 gfx::RectF(combinedClip)); |
| 289 endDisplayItems.push_back(EndClip); | 289 endDisplayItems.push_back(EndClip); |
| 290 } | 290 } |
| 291 | 291 |
| 292 static void recordPairedBeginDisplayItems( | 292 static void recordPairedBeginDisplayItems( |
| 293 const Vector<PropertyTreeState>& pairedStates, | 293 const Vector<PropertyTreeState>& pairedStates, |
| 294 const PropertyTreeState& pendingLayerState, | 294 const PropertyTreeState& pendingLayerState, |
| 295 cc::DisplayItemList& ccList, | 295 cc::DisplayItemList& ccList, |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 | 593 |
| 594 bool PaintArtifactCompositor::mightOverlap( | 594 bool PaintArtifactCompositor::mightOverlap( |
| 595 const PaintChunk& paintChunk, | 595 const PaintChunk& paintChunk, |
| 596 const PendingLayer& candidatePendingLayer, | 596 const PendingLayer& candidatePendingLayer, |
| 597 GeometryMapper& geometryMapper) { | 597 GeometryMapper& geometryMapper) { |
| 598 PropertyTreeState rootPropertyTreeState(TransformPaintPropertyNode::root(), | 598 PropertyTreeState rootPropertyTreeState(TransformPaintPropertyNode::root(), |
| 599 ClipPaintPropertyNode::root(), | 599 ClipPaintPropertyNode::root(), |
| 600 EffectPaintPropertyNode::root()); | 600 EffectPaintPropertyNode::root()); |
| 601 | 601 |
| 602 FloatRect paintChunkScreenVisualRect = | 602 FloatRect paintChunkScreenVisualRect = |
| 603 geometryMapper.localToAncestorVisualRect( | 603 geometryMapper |
| 604 paintChunk.bounds, paintChunk.properties.propertyTreeState, | 604 .localToAncestorVisualRect(paintChunk.bounds, |
| 605 rootPropertyTreeState); | 605 paintChunk.properties.propertyTreeState, |
| 606 rootPropertyTreeState) |
| 607 .rect(); |
| 606 | 608 |
| 607 FloatRect pendingLayerScreenVisualRect = | 609 FloatRect pendingLayerScreenVisualRect = |
| 608 geometryMapper.localToAncestorVisualRect( | 610 geometryMapper |
| 609 candidatePendingLayer.bounds, candidatePendingLayer.propertyTreeState, | 611 .localToAncestorVisualRect(candidatePendingLayer.bounds, |
| 610 rootPropertyTreeState); | 612 candidatePendingLayer.propertyTreeState, |
| 613 rootPropertyTreeState) |
| 614 .rect(); |
| 611 | 615 |
| 612 return paintChunkScreenVisualRect.intersects(pendingLayerScreenVisualRect); | 616 return paintChunkScreenVisualRect.intersects(pendingLayerScreenVisualRect); |
| 613 } | 617 } |
| 614 | 618 |
| 615 PaintArtifactCompositor::PendingLayer::PendingLayer( | 619 PaintArtifactCompositor::PendingLayer::PendingLayer( |
| 616 const PaintChunk& firstPaintChunk) | 620 const PaintChunk& firstPaintChunk) |
| 617 : bounds(firstPaintChunk.bounds), | 621 : bounds(firstPaintChunk.bounds), |
| 618 knownToBeOpaque(firstPaintChunk.knownToBeOpaque), | 622 knownToBeOpaque(firstPaintChunk.knownToBeOpaque), |
| 619 backfaceHidden(firstPaintChunk.properties.backfaceHidden), | 623 backfaceHidden(firstPaintChunk.properties.backfaceHidden), |
| 620 propertyTreeState(firstPaintChunk.properties.propertyTreeState) { | 624 propertyTreeState(firstPaintChunk.properties.propertyTreeState) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 #ifndef NDEBUG | 748 #ifndef NDEBUG |
| 745 void PaintArtifactCompositor::showDebugData() { | 749 void PaintArtifactCompositor::showDebugData() { |
| 746 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) | 750 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) |
| 747 ->toPrettyJSONString() | 751 ->toPrettyJSONString() |
| 748 .utf8() | 752 .utf8() |
| 749 .data(); | 753 .data(); |
| 750 } | 754 } |
| 751 #endif | 755 #endif |
| 752 | 756 |
| 753 } // namespace blink | 757 } // namespace blink |
| OLD | NEW |