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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another media track layout test. Created 5 years 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 /* 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "core/paint/TransformRecorder.h" 56 #include "core/paint/TransformRecorder.h"
57 #include "platform/RuntimeEnabledFeatures.h" 57 #include "platform/RuntimeEnabledFeatures.h"
58 #include "platform/ScriptForbiddenScope.h" 58 #include "platform/ScriptForbiddenScope.h"
59 #include "platform/TraceEvent.h" 59 #include "platform/TraceEvent.h"
60 #include "platform/graphics/GraphicsLayer.h" 60 #include "platform/graphics/GraphicsLayer.h"
61 #include "platform/graphics/paint/CullRect.h" 61 #include "platform/graphics/paint/CullRect.h"
62 #include "platform/graphics/paint/DrawingRecorder.h" 62 #include "platform/graphics/paint/DrawingRecorder.h"
63 #include "platform/graphics/paint/PaintController.h" 63 #include "platform/graphics/paint/PaintController.h"
64 #include "platform/graphics/paint/TransformDisplayItem.h" 64 #include "platform/graphics/paint/TransformDisplayItem.h"
65 #include "public/platform/Platform.h" 65 #include "public/platform/Platform.h"
66 #include "public/platform/WebCompositorMutableProperties.h"
66 67
67 namespace blink { 68 namespace blink {
68 69
69 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView) 70 PaintLayerCompositor::PaintLayerCompositor(LayoutView& layoutView)
70 : m_layoutView(layoutView) 71 : m_layoutView(layoutView)
71 , m_compositingReasonFinder(layoutView) 72 , m_compositingReasonFinder(layoutView)
72 , m_pendingUpdateType(CompositingUpdateNone) 73 , m_pendingUpdateType(CompositingUpdateNone)
73 , m_hasAcceleratedCompositing(true) 74 , m_hasAcceleratedCompositing(true)
74 , m_compositing(false) 75 , m_compositing(false)
75 , m_rootShouldAlwaysCompositeDirty(true) 76 , m_rootShouldAlwaysCompositeDirty(true)
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 for (ScrollableArea* scrollableArea : *scrollableAreas) 385 for (ScrollableArea* scrollableArea : *scrollableAreas)
385 layersChanged |= scrollableArea->updateAfterCompositingChang e(); 386 layersChanged |= scrollableArea->updateAfterCompositingChang e();
386 } 387 }
387 } 388 }
388 389
389 if (layersChanged) 390 if (layersChanged)
390 updateType = std::max(updateType, CompositingUpdateRebuildTree); 391 updateType = std::max(updateType, CompositingUpdateRebuildTree);
391 } 392 }
392 393
393 if (updateType != CompositingUpdateNone) { 394 if (updateType != CompositingUpdateNone) {
395 if (RuntimeEnabledFeatures::compositorWorkerEnabled() && m_scrollLayer) {
chrishtr 2015/12/01 23:17:03 Is there a testcase for the code here?
Ian Vollick 2015/12/02 00:39:33 Yes. In CompositorWorkerTest, I test three types o
396 if (Element* scrollingElement = m_layoutView.document().scrollingEle ment()) {
397 uint64_t elementId = 0;
398 uint32_t mutableProperties = WebCompositorMutablePropertyNone;
399 if (scrollingElement->hasCompositorProxy()) {
400 elementId = DOMNodeIds::idForNode(scrollingElement);
401 mutableProperties = (WebCompositorMutablePropertyScrollLeft | WebCompositorMutablePropertyScrollTop) & scrollingElement->compositorMutablePr operties();
402 }
403 m_scrollLayer->setElementId(elementId);
404 m_scrollLayer->setCompositorMutableProperties(mutableProperties) ;
405 }
406 }
407
394 GraphicsLayerUpdater updater; 408 GraphicsLayerUpdater updater;
395 updater.update(*updateRoot, layersNeedingPaintInvalidation); 409 updater.update(*updateRoot, layersNeedingPaintInvalidation);
396 410
397 if (updater.needsRebuildTree()) 411 if (updater.needsRebuildTree())
398 updateType = std::max(updateType, CompositingUpdateRebuildTree); 412 updateType = std::max(updateType, CompositingUpdateRebuildTree);
399 413
400 #if ENABLE(ASSERT) 414 #if ENABLE(ASSERT)
401 // FIXME: Move this check to the end of the compositing update. 415 // FIXME: Move this check to the end of the compositing update.
402 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat eRoot); 416 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat eRoot);
403 #endif 417 #endif
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 } else if (graphicsLayer == m_scrollLayer.get()) { 1209 } else if (graphicsLayer == m_scrollLayer.get()) {
1196 name = "Frame Scrolling Layer"; 1210 name = "Frame Scrolling Layer";
1197 } else { 1211 } else {
1198 ASSERT_NOT_REACHED(); 1212 ASSERT_NOT_REACHED();
1199 } 1213 }
1200 1214
1201 return name; 1215 return name;
1202 } 1216 }
1203 1217
1204 } // namespace blink 1218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698