Commit c7f8ce16 authored by Sam Fortiner's avatar Sam Fortiner Committed by Commit Bot

Remove GraphicsLayer::GetPosition and SetPosition

The last remaining use of GraphicsLayer's position, including
side-effects such as non-UI code reads of cc Layer::position which is
set via GraphicsLayer::SetPosition, is UpdateMainGraphicsLayerGeometry
where it is used to determine if the position changed and a call to
SetPosition is needed.  Since there are no other readers of this data,
this callsite can be removed along with all other SetPosition callsites
and supporting (now unused) code.  This has no functional impact on
Blink composition as layer position has already moved over to using
BGPT.

Bug: 999336
Change-Id: I7937c601269bafb515ad1ce16231dbacf70b8efb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935499
Commit-Queue: Sam Fortiner <samfort@microsoft.com>
Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719316}
parent 4bb9419a
...@@ -98,9 +98,7 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -98,9 +98,7 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
const PaintLayer* compositing_container); const PaintLayer* compositing_container);
void UpdateGraphicsLayerGeometry( void UpdateGraphicsLayerGeometry(
const PaintLayer* compositing_container, const PaintLayer* compositing_container,
const PaintLayer* compositing_stacking_context, Vector<PaintLayer*>& layers_needing_paint_invalidation);
Vector<PaintLayer*>& layers_needing_paint_invalidation,
GraphicsLayerUpdater::UpdateContext& update_context);
// Update whether background paints onto scrolling contents layer. // Update whether background paints onto scrolling contents layer.
// Returns (through the reference params) what invalidations are needed. // Returns (through the reference params) what invalidations are needed.
...@@ -306,26 +304,19 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -306,26 +304,19 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
const PaintLayer* compositing_container, const PaintLayer* compositing_container,
IntPoint& graphics_layer_parent_location); IntPoint& graphics_layer_parent_location);
void UpdateSquashingLayerGeometry( void UpdateSquashingLayerGeometry(
const IntPoint& graphics_layer_parent_location,
const PaintLayer* compositing_container, const PaintLayer* compositing_container,
const IntPoint& snapped_offset_from_composited_ancestor, const IntPoint& snapped_offset_from_composited_ancestor,
Vector<GraphicsLayerPaintInfo>& layers, Vector<GraphicsLayerPaintInfo>& layers,
Vector<PaintLayer*>& layers_needing_paint_invalidation); Vector<PaintLayer*>& layers_needing_paint_invalidation);
void UpdateMainGraphicsLayerGeometry( void UpdateMainGraphicsLayerGeometry(const IntRect& local_compositing_bounds);
const IntRect& relative_compositing_bounds,
const IntRect& local_compositing_bounds,
const IntPoint& graphics_layer_parent_location,
GraphicsLayerUpdater::UpdateContext& update_context);
void UpdateOverflowControlsHostLayerGeometry( void UpdateOverflowControlsHostLayerGeometry(
const PaintLayer* compositing_stacking_context, const PaintLayer* compositing_container);
const PaintLayer* compositing_container,
IntPoint graphics_layer_parent_location);
void UpdateChildTransformLayerGeometry(); void UpdateChildTransformLayerGeometry();
void UpdateMaskLayerGeometry(); void UpdateMaskLayerGeometry();
void UpdateForegroundLayerGeometry(); void UpdateForegroundLayerGeometry();
void UpdateDecorationOutlineLayerGeometry( void UpdateDecorationOutlineLayerGeometry(
const IntSize& relative_compositing_bounds_size); const IntSize& relative_compositing_bounds_size);
void UpdateScrollingLayerGeometry(const IntRect& local_compositing_bounds); void UpdateScrollingLayerGeometry();
void CreatePrimaryGraphicsLayer(); void CreatePrimaryGraphicsLayer();
void DestroyGraphicsLayers(); void DestroyGraphicsLayers();
...@@ -364,8 +355,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -364,8 +355,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
void ComputeBoundsOfOwningLayer( void ComputeBoundsOfOwningLayer(
const PaintLayer* composited_ancestor, const PaintLayer* composited_ancestor,
IntRect& local_compositing_bounds, IntRect& local_compositing_bounds,
IntRect& compositing_bounds_relative_to_composited_ancestor,
PhysicalOffset& offset_from_composited_ancestor,
IntPoint& snapped_offset_from_composited_ancestor); IntPoint& snapped_offset_from_composited_ancestor);
GraphicsLayerPaintingPhase PaintingPhaseForPrimaryLayer() const; GraphicsLayerPaintingPhase PaintingPhaseForPrimaryLayer() const;
...@@ -388,7 +377,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -388,7 +377,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
Color LayoutObjectBackgroundColor() const; Color LayoutObjectBackgroundColor() const;
void UpdateBackgroundColor(); void UpdateBackgroundColor();
void UpdateContentsRect(); void UpdateContentsRect();
void UpdateAfterPartResize();
void UpdateCompositingReasons(); void UpdateCompositingReasons();
static bool HasVisibleNonCompositingDescendant(PaintLayer* parent); static bool HasVisibleNonCompositingDescendant(PaintLayer* parent);
...@@ -413,9 +401,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -413,9 +401,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
// that layer does not appear earlier in the set of layers for this object. // that layer does not appear earlier in the set of layers for this object.
bool InvalidateLayerIfNoPrecedingEntry(wtf_size_t); bool InvalidateLayerIfNoPrecedingEntry(wtf_size_t);
// Main GraphicsLayer of the CLM for the iframe's content document.
GraphicsLayer* FrameContentsGraphicsLayer() const;
PaintLayer& owning_layer_; PaintLayer& owning_layer_;
// The hierarchy of layers that is maintained by the CompositedLayerMapping // The hierarchy of layers that is maintained by the CompositedLayerMapping
......
...@@ -133,9 +133,8 @@ void GraphicsLayerUpdater::UpdateRecursive( ...@@ -133,9 +133,8 @@ void GraphicsLayerUpdater::UpdateRecursive(
if (had_scrolling_layer != !!mapping->ScrollingLayer()) if (had_scrolling_layer != !!mapping->ScrollingLayer())
layers_needing_paint_invalidation.push_back(&layer); layers_needing_paint_invalidation.push_back(&layer);
} }
mapping->UpdateGraphicsLayerGeometry( mapping->UpdateGraphicsLayerGeometry(compositing_container,
compositing_container, context.CompositingStackingContext(), layers_needing_paint_invalidation);
layers_needing_paint_invalidation, context);
if (PaintLayerScrollableArea* scrollable_area = layer.GetScrollableArea()) if (PaintLayerScrollableArea* scrollable_area = layer.GetScrollableArea())
scrollable_area->PositionOverflowControls(); scrollable_area->PositionOverflowControls();
update_type = mapping->UpdateTypeForChildren(update_type); update_type = mapping->UpdateTypeForChildren(update_type);
......
...@@ -319,17 +319,6 @@ GraphicsLayer* PaintLayerCompositor::OverlayFullscreenVideoGraphicsLayer() ...@@ -319,17 +319,6 @@ GraphicsLayer* PaintLayerCompositor::OverlayFullscreenVideoGraphicsLayer()
return video->Layer()->GetCompositedLayerMapping()->MainGraphicsLayer(); return video->Layer()->GetCompositedLayerMapping()->MainGraphicsLayer();
} }
void PaintLayerCompositor::AdjustOverlayFullscreenVideoPosition(
GraphicsLayer* video_layer) {
if (!video_layer)
return;
// The fullscreen video has layer position equal to its enclosing frame's
// scroll position because fullscreen container is fixed-positioned.
// We should reset layer position here since it is attached at the
// very top level.
video_layer->SetPosition(FloatPoint());
}
void PaintLayerCompositor::UpdateWithoutAcceleratedCompositing( void PaintLayerCompositor::UpdateWithoutAcceleratedCompositing(
CompositingUpdateType update_type) { CompositingUpdateType update_type) {
DCHECK(!HasAcceleratedCompositing()); DCHECK(!HasAcceleratedCompositing());
...@@ -486,7 +475,6 @@ void PaintLayerCompositor::UpdateIfNeeded( ...@@ -486,7 +475,6 @@ void PaintLayerCompositor::UpdateIfNeeded(
current_parent->SetChildren(child_list); current_parent->SetChildren(child_list);
} }
} }
AdjustOverlayFullscreenVideoPosition(OverlayFullscreenVideoGraphicsLayer());
for (unsigned i = 0; i < layers_needing_paint_invalidation.size(); i++) { for (unsigned i = 0; i < layers_needing_paint_invalidation.size(); i++) {
ForceRecomputeVisualRectsIncludingNonCompositingDescendants( ForceRecomputeVisualRectsIncludingNonCompositingDescendants(
......
...@@ -186,7 +186,6 @@ class CORE_EXPORT PaintLayerCompositor { ...@@ -186,7 +186,6 @@ class CORE_EXPORT PaintLayerCompositor {
void EnableCompositingModeIfNeeded(); void EnableCompositingModeIfNeeded();
void AdjustOverlayFullscreenVideoPosition(GraphicsLayer*);
GraphicsLayer* OverlayFullscreenVideoGraphicsLayer() const; GraphicsLayer* OverlayFullscreenVideoGraphicsLayer() const;
// Checks the given graphics layer against the compositor's horizontal and // Checks the given graphics layer against the compositor's horizontal and
......
...@@ -585,14 +585,6 @@ String GraphicsLayer::DebugName(const cc::Layer* layer) const { ...@@ -585,14 +585,6 @@ String GraphicsLayer::DebugName(const cc::Layer* layer) const {
return ""; return "";
} }
void GraphicsLayer::SetPosition(const gfx::PointF& point) {
CcLayer()->SetPosition(point);
}
const gfx::PointF& GraphicsLayer::GetPosition() const {
return CcLayer()->position();
}
const gfx::Size& GraphicsLayer::Size() const { const gfx::Size& GraphicsLayer::Size() const {
return CcLayer()->bounds(); return CcLayer()->bounds();
} }
......
...@@ -121,11 +121,6 @@ class PLATFORM_EXPORT GraphicsLayer : public DisplayItemClient, ...@@ -121,11 +121,6 @@ class PLATFORM_EXPORT GraphicsLayer : public DisplayItemClient,
IntSize OffsetFromLayoutObject() const { return offset_from_layout_object_; } IntSize OffsetFromLayoutObject() const { return offset_from_layout_object_; }
void SetOffsetFromLayoutObject(const IntSize&); void SetOffsetFromLayoutObject(const IntSize&);
// The position of the layer (the location of its top-left corner in its
// parent).
const gfx::PointF& GetPosition() const;
void SetPosition(const gfx::PointF&);
// The size of the layer. // The size of the layer.
const gfx::Size& Size() const; const gfx::Size& Size() const;
void SetSize(const gfx::Size&); void SetSize(const gfx::Size&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment