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

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: s/WebMutable/WebCompositorMutable/g Created 5 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
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 // FIXME: it should not be necessary to check that the document has no c hild needing a style recalc. See crbug.com/552847
396 if (RuntimeEnabledFeatures::compositorWorkerEnabled() && m_scrollLayer & & !m_layoutView.document().childNeedsStyleRecalc()) {
chrishtr 2015/11/24 16:22:50 What is actually happening? Let's squash this bug
Ian Vollick 2015/11/25 18:28:45 This is an old, unrelated video bug (https://code.
397 if (Element* scrollingElement = m_layoutView.document().scrollingEle ment()) {
398 uint64_t elementId = 0;
399 uint32_t mutableProperties = WebCompositorMutablePropertyNone;
400 if (scrollingElement->hasCompositorProxy()) {
401 elementId = DOMNodeIds::idForNode(scrollingElement);
402 mutableProperties = WebCompositorMutablePropertyScrollLeft | WebCompositorMutablePropertyScrollTop;
403 }
404 m_scrollLayer->setElementId(elementId);
405 m_scrollLayer->setMutableProperties(mutableProperties);
406 }
407 }
408
394 GraphicsLayerUpdater updater; 409 GraphicsLayerUpdater updater;
395 updater.update(*updateRoot, layersNeedingPaintInvalidation); 410 updater.update(*updateRoot, layersNeedingPaintInvalidation);
396 411
397 if (updater.needsRebuildTree()) 412 if (updater.needsRebuildTree())
398 updateType = std::max(updateType, CompositingUpdateRebuildTree); 413 updateType = std::max(updateType, CompositingUpdateRebuildTree);
399 414
400 #if ENABLE(ASSERT) 415 #if ENABLE(ASSERT)
401 // FIXME: Move this check to the end of the compositing update. 416 // FIXME: Move this check to the end of the compositing update.
402 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat eRoot); 417 GraphicsLayerUpdater::assertNeedsToUpdateGraphicsLayerBitsCleared(*updat eRoot);
403 #endif 418 #endif
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 } else if (graphicsLayer == m_scrollLayer.get()) { 1219 } else if (graphicsLayer == m_scrollLayer.get()) {
1205 name = "Frame Scrolling Layer"; 1220 name = "Frame Scrolling Layer";
1206 } else { 1221 } else {
1207 ASSERT_NOT_REACHED(); 1222 ASSERT_NOT_REACHED();
1208 } 1223 }
1209 1224
1210 return name; 1225 return name;
1211 } 1226 }
1212 1227
1213 } // namespace blink 1228 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698