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

Side by Side Diff: sky/engine/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 661633003: Get rid of slow repaint objects and main thread scrolling reasons. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: merge to ToT Created 6 years, 1 month 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
« no previous file with comments | « sky/engine/core/rendering/RenderObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 // If this layer was previously squashed, we need to remove its referenc e to a groupedMapping right away, so 310 // If this layer was previously squashed, we need to remove its referenc e to a groupedMapping right away, so
311 // that computing paint invalidation rects will know the layer's correct compositingState. 311 // that computing paint invalidation rects will know the layer's correct compositingState.
312 // FIXME: do we need to also remove the layer from it's location in the squashing list of its groupedMapping? 312 // FIXME: do we need to also remove the layer from it's location in the squashing list of its groupedMapping?
313 // Need to create a test where a squashed layer pops into compositing. A nd also to cover all other 313 // Need to create a test where a squashed layer pops into compositing. A nd also to cover all other
314 // sorts of compositingState transitions. 314 // sorts of compositingState transitions.
315 layer->setLostGroupedMapping(false); 315 layer->setLostGroupedMapping(false);
316 layer->setGroupedMapping(0); 316 layer->setGroupedMapping(0);
317 317
318 layer->ensureCompositedLayerMapping(); 318 layer->ensureCompositedLayerMapping();
319 compositedLayerMappingChanged = true; 319 compositedLayerMappingChanged = true;
320
321 // At this time, the ScrollingCooridnator only supports the top-level fr ame.
322 if (layer->isRootLayer()) {
323 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoor dinator())
324 scrollingCoordinator->frameViewRootLayerDidChange(m_renderView.f rameView());
325 }
326 break; 320 break;
327 case RemoveOwnCompositedLayerMapping: 321 case RemoveOwnCompositedLayerMapping:
328 // PutInSquashingLayer means you might have to remove the composited layer m apping first. 322 // PutInSquashingLayer means you might have to remove the composited layer m apping first.
329 case PutInSquashingLayer: 323 case PutInSquashingLayer:
330 if (layer->hasCompositedLayerMapping()) { 324 if (layer->hasCompositedLayerMapping()) {
331 layer->clearCompositedLayerMapping(); 325 layer->clearCompositedLayerMapping();
332 compositedLayerMappingChanged = true; 326 compositedLayerMappingChanged = true;
333 } 327 }
334 328
335 break; 329 break;
336 case RemoveFromSquashingLayer: 330 case RemoveFromSquashingLayer:
337 case NoCompositingStateChange: 331 case NoCompositingStateChange:
338 // Do nothing. 332 // Do nothing.
339 break; 333 break;
340 } 334 }
341 335
342 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons()) 336 if (layer->hasCompositedLayerMapping() && layer->compositedLayerMapping()->u pdateRequiresOwnBackingStoreForIntrinsicReasons())
343 compositedLayerMappingChanged = true; 337 compositedLayerMappingChanged = true;
344 338
345 if (compositedLayerMappingChanged && layer->renderer()->isRenderPart()) { 339 if (compositedLayerMappingChanged && layer->renderer()->isRenderPart()) {
346 RenderLayerCompositor* innerCompositor = frameContentsCompositor(toRende rPart(layer->renderer())); 340 RenderLayerCompositor* innerCompositor = frameContentsCompositor(toRende rPart(layer->renderer()));
347 if (innerCompositor && innerCompositor->staleInCompositingMode()) 341 if (innerCompositor && innerCompositor->staleInCompositingMode())
348 innerCompositor->updateRootLayerAttachment(); 342 innerCompositor->updateRootLayerAttachment();
349 } 343 }
350 344
351 if (compositedLayerMappingChanged) 345 if (compositedLayerMappingChanged)
352 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects); 346 layer->clipper().clearClipRectsIncludingDescendants(PaintingClipRects);
353 347
354 // If a fixed position layer gained/lost a compositedLayerMapping or the rea son not compositing it changed,
355 // the scrolling coordinator needs to recalculate whether it can do fast scr olling.
356 if (compositedLayerMappingChanged) {
357 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordina tor())
358 scrollingCoordinator->frameViewFixedObjectsDidChange(m_renderView.fr ameView());
359 }
360
361 return compositedLayerMappingChanged; 348 return compositedLayerMappingChanged;
362 } 349 }
363 350
364 void RenderLayerCompositor::paintInvalidationOnCompositingChange(RenderLayer* la yer) 351 void RenderLayerCompositor::paintInvalidationOnCompositingChange(RenderLayer* la yer)
365 { 352 {
366 // If the renderer is not attached yet, no need to issue paint invalidations . 353 // If the renderer is not attached yet, no need to issue paint invalidations .
367 if (layer->renderer() != &m_renderView && !layer->renderer()->parent()) 354 if (layer->renderer() != &m_renderView && !layer->renderer()->parent())
368 return; 355 return;
369 356
370 // For querying RenderLayer::compositingState() 357 // For querying RenderLayer::compositingState()
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 } else if (graphicsLayer == m_scrollLayer.get()) { 924 } else if (graphicsLayer == m_scrollLayer.get()) {
938 name = "LocalFrame Scrolling Layer"; 925 name = "LocalFrame Scrolling Layer";
939 } else { 926 } else {
940 ASSERT_NOT_REACHED(); 927 ASSERT_NOT_REACHED();
941 } 928 }
942 929
943 return name; 930 return name;
944 } 931 }
945 932
946 } // namespace blink 933 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/RenderObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698