@@ -42,8 +42,6 @@ static constexpr SkRect kGiantRect = SkRect::MakeLTRB(-1E9F, -1E9F, 1E9F, 1E9F);
4242// This should be an exact copy of the Clip enum in painting.dart.
4343enum Clip { none, hardEdge, antiAlias, antiAliasWithSaveLayer };
4444
45- class ContainerLayer ;
46-
4745struct PrerollContext {
4846 RasterCache* raster_cache;
4947 GrContext* gr_context;
@@ -53,11 +51,18 @@ struct PrerollContext {
5351 SkRect cull_rect;
5452 bool surface_needs_readback;
5553
56- // The following allows us to paint in the end of subtree preroll
54+ // These allow us to paint in the end of subtree Preroll.
5755 const Stopwatch& raster_time;
5856 const Stopwatch& ui_time;
5957 TextureRegistry& texture_registry;
6058 const bool checkerboard_offscreen_layers;
59+
60+ // These allow us to make use of the scene metrics during Preroll.
61+ float frame_physical_depth;
62+ float frame_device_pixel_ratio;
63+
64+ // These allow us to track properties like elevation and opacity which stack
65+ // with each other during Preroll.
6166 float total_elevation = 0 .0f ;
6267 bool has_platform_view = false ;
6368};
@@ -117,6 +122,10 @@ class Layer {
117122 TextureRegistry& texture_registry;
118123 const RasterCache* raster_cache;
119124 const bool checkerboard_offscreen_layers;
125+
126+ // These allow us to make use of the scene metrics during Paint.
127+ float frame_physical_depth;
128+ float frame_device_pixel_ratio;
120129 };
121130
122131 // Calls SkCanvas::saveLayer and restores the layer upon destruction. Also
@@ -153,10 +162,6 @@ class Layer {
153162 virtual void UpdateScene (SceneUpdateContext& context);
154163#endif
155164
156- ContainerLayer* parent () const { return parent_; }
157-
158- void set_parent (ContainerLayer* parent) { parent_ = parent; }
159-
160165 bool needs_system_composite () const { return needs_system_composite_; }
161166 void set_needs_system_composite (bool value) {
162167 needs_system_composite_ = value;
@@ -175,10 +180,9 @@ class Layer {
175180 uint64_t unique_id () const { return unique_id_; }
176181
177182 private:
178- ContainerLayer* parent_;
179- bool needs_system_composite_;
180183 SkRect paint_bounds_;
181184 uint64_t unique_id_;
185+ bool needs_system_composite_;
182186
183187 static uint64_t NextUniqueID ();
184188
0 commit comments