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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2604163003: Implement PaintArtifactCompositor::mightOverlap. (Closed)
Patch Set: none Created 3 years, 11 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 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 if (*currentState == candidatePendingLayer.propertyTreeState) 1034 if (*currentState == candidatePendingLayer.propertyTreeState)
1035 return true; 1035 return true;
1036 } 1036 }
1037 return false; 1037 return false;
1038 } 1038 }
1039 1039
1040 bool PaintArtifactCompositor::mightOverlap( 1040 bool PaintArtifactCompositor::mightOverlap(
1041 const PaintChunk& paintChunk, 1041 const PaintChunk& paintChunk,
1042 const PendingLayer& candidatePendingLayer, 1042 const PendingLayer& candidatePendingLayer,
1043 GeometryMapper& geometryMapper) { 1043 GeometryMapper& geometryMapper) {
1044 // TODO(chrishtr): implement 1044 PropertyTreeState rootPropertyTreeState(
wkorman 2016/12/29 19:49:40 nit: could be worth adding a static instance for t
chrishtr 2016/12/29 19:52:29 Good idea. I have a cleanup CL for PaintArtifactCo
1045 return true; 1045 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(),
1046 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root());
1047
1048 bool success = false;
1049 FloatRect paintChunkScreenVisualRect =
1050 geometryMapper.localToVisualRectInAncestorSpace(
1051 paintChunk.bounds, paintChunk.properties.propertyTreeState,
1052 rootPropertyTreeState, success);
1053 DCHECK(success);
1054
1055 success = false;
1056 FloatRect pendingLayerScreenVisualRect =
1057 geometryMapper.localToVisualRectInAncestorSpace(
1058 candidatePendingLayer.bounds, candidatePendingLayer.propertyTreeState,
1059 rootPropertyTreeState, success);
1060 DCHECK(success);
1061
1062 return paintChunkScreenVisualRect.intersects(pendingLayerScreenVisualRect);
1046 } 1063 }
1047 1064
1048 PaintArtifactCompositor::PendingLayer::PendingLayer( 1065 PaintArtifactCompositor::PendingLayer::PendingLayer(
1049 const PaintChunk& firstPaintChunk) 1066 const PaintChunk& firstPaintChunk)
1050 : bounds(firstPaintChunk.bounds), 1067 : bounds(firstPaintChunk.bounds),
1051 knownToBeOpaque(firstPaintChunk.knownToBeOpaque), 1068 knownToBeOpaque(firstPaintChunk.knownToBeOpaque),
1052 backfaceHidden(firstPaintChunk.properties.backfaceHidden), 1069 backfaceHidden(firstPaintChunk.properties.backfaceHidden),
1053 propertyTreeState(firstPaintChunk.properties.propertyTreeState) { 1070 propertyTreeState(firstPaintChunk.properties.propertyTreeState) {
1054 paintChunks.append(&firstPaintChunk); 1071 paintChunks.append(&firstPaintChunk);
1055 } 1072 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 #ifndef NDEBUG 1200 #ifndef NDEBUG
1184 void PaintArtifactCompositor::showDebugData() { 1201 void PaintArtifactCompositor::showDebugData() {
1185 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) 1202 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo)
1186 ->toPrettyJSONString() 1203 ->toPrettyJSONString()
1187 .utf8() 1204 .utf8()
1188 .data(); 1205 .data();
1189 } 1206 }
1190 #endif 1207 #endif
1191 1208
1192 } // namespace blink 1209 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698