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

Side by Side Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 14741004: NOT FOR REVIEW - Update comp-scrolling state at a well defined point in the pipeline. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added annotations describing how this patch will be split. Created 7 years, 7 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
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 , m_hasAcceleratedCompositing(true) 211 , m_hasAcceleratedCompositing(true)
212 , m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(C hromeClient::AllTriggers)) 212 , m_compositingTriggers(static_cast<ChromeClient::CompositingTriggerFlags>(C hromeClient::AllTriggers))
213 , m_compositedLayerCount(0) 213 , m_compositedLayerCount(0)
214 , m_showDebugBorders(false) 214 , m_showDebugBorders(false)
215 , m_showRepaintCounter(false) 215 , m_showRepaintCounter(false)
216 , m_reevaluateCompositingAfterLayout(false) 216 , m_reevaluateCompositingAfterLayout(false)
217 , m_compositing(false) 217 , m_compositing(false)
218 , m_compositingLayersNeedRebuild(false) 218 , m_compositingLayersNeedRebuild(false)
219 , m_forceCompositingMode(false) 219 , m_forceCompositingMode(false)
220 , m_inPostLayoutUpdate(false) 220 , m_inPostLayoutUpdate(false)
221 // PATCH 2
222 , m_needsUpdateCompositingRequirementsState(false)
221 , m_isTrackingRepaints(false) 223 , m_isTrackingRepaints(false)
222 , m_rootLayerAttachment(RootLayerUnattached) 224 , m_rootLayerAttachment(RootLayerUnattached)
223 #if !LOG_DISABLED 225 #if !LOG_DISABLED
224 , m_rootLayerUpdateCount(0) 226 , m_rootLayerUpdateCount(0)
225 , m_obligateCompositedLayerCount(0) 227 , m_obligateCompositedLayerCount(0)
226 , m_secondaryCompositedLayerCount(0) 228 , m_secondaryCompositedLayerCount(0)
227 , m_obligatoryBackingStoreBytes(0) 229 , m_obligatoryBackingStoreBytes(0)
228 , m_secondaryBackingStoreBytes(0) 230 , m_secondaryBackingStoreBytes(0)
229 #endif 231 #endif
230 { 232 {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 if (Page* page = this->page()) 325 if (Page* page = this->page())
324 page->chrome()->client()->scheduleCompositingLayerFlush(); 326 page->chrome()->client()->scheduleCompositingLayerFlush();
325 } 327 }
326 } 328 }
327 329
328 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const 330 bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer* rootLayer) const
329 { 331 {
330 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0); 332 return m_compositedLayerCount > (rootLayer->isComposited() ? 1 : 0);
331 } 333 }
332 334
335 // PATCH 2
336 void RenderLayerCompositor::updateCompositingRequirementsState(CompositingUpdate Type updateType, RenderLayer* updateRoot)
337 {
338 if (!m_needsUpdateCompositingRequirementsState)
339 return;
340
341 const bool firstIteration = !updateRoot;
342 if (!updateRoot) {
343 bool needsUpdateHasOutOfFlowPositionedDescendant = false;
344 switch (updateType) {
345 case CompositingUpdateAfterStyleChange:
346 needsUpdateHasOutOfFlowPositionedDescendant = true;
347 break;
348 case CompositingUpdateAfterLayout:
349 break;
350 case CompositingUpdateOnScroll:
351 case CompositingUpdateOnCompositedScroll:
352 ASSERT_NOT_REACHED();
353 break;
354 }
355
356 updateRoot = rootRenderLayer();
357 updateRoot->updateDescendantDependentFlags();
358 if (needsUpdateHasOutOfFlowPositionedDescendant) {
359 updateRoot->updateHasOutOfFlowPositionedDescendant();
360 }
361 }
362
363 updateRoot->updateNeedsCompositedScrolling();
364
365 // In this function we update state that determines whether layers are
366 // stacking containers. We may therefore not use this concept here. Instead,
367 // we'll iterate through the tree topologically.
368 for (RenderLayer* child = updateRoot->firstChild(); child; child = child->ne xtSibling())
369 updateCompositingRequirementsState(updateType, child);
370
371 if (firstIteration)
372 m_needsUpdateCompositingRequirementsState = false;
373 }
374
333 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot) 375 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType update Type, RenderLayer* updateRoot)
334 { 376 {
335 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished. 377 // Avoid updating the layers with old values. Compositing layers will be upd ated after the layout is finished.
336 if (m_renderView->needsLayout()) 378 if (m_renderView->needsLayout())
337 return; 379 return;
338 380
339 if (m_forceCompositingMode && !m_compositing) 381 if (m_forceCompositingMode && !m_compositing)
340 enableCompositingMode(true); 382 enableCompositingMode(true);
341 383
342 if (!m_reevaluateCompositingAfterLayout && !m_compositing) 384 if (!m_reevaluateCompositingAfterLayout && !m_compositing)
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2758 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2800 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2759 #if ENABLE(RUBBER_BANDING) 2801 #if ENABLE(RUBBER_BANDING)
2760 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2802 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2761 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2803 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2762 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2804 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2763 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2805 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2764 #endif 2806 #endif
2765 } 2807 }
2766 2808
2767 } // namespace WebCore 2809 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698