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

Side by Side Diff: cc/layers/picture_layer_impl.h

Issue 519583003: Use the solid color detection to create solid layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a unit test for solid color on picturelayerimpl Created 6 years, 3 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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_
6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE; 143 virtual void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) OVERRIDE;
144 144
145 // Functions used by tile manager. 145 // Functions used by tile manager.
146 PictureLayerImpl* GetTwinLayer() { return twin_layer_; } 146 PictureLayerImpl* GetTwinLayer() { return twin_layer_; }
147 bool IsOnActiveOrPendingTree() const; 147 bool IsOnActiveOrPendingTree() const;
148 // Virtual for testing. 148 // Virtual for testing.
149 virtual bool HasValidTilePriorities() const; 149 virtual bool HasValidTilePriorities() const;
150 bool AllTilesRequiredForActivationAreReadyToDraw() const; 150 bool AllTilesRequiredForActivationAreReadyToDraw() const;
151 151
152 void SetSolidColorState(bool is_solid_color, SkColor solid_color);
153 bool IsSolidColor() const { return is_solid_color_; }
154
152 protected: 155 protected:
153 friend class LayerRasterTileIterator; 156 friend class LayerRasterTileIterator;
154 157
155 PictureLayerImpl(LayerTreeImpl* tree_impl, int id); 158 PictureLayerImpl(LayerTreeImpl* tree_impl, int id);
156 PictureLayerTiling* AddTiling(float contents_scale); 159 PictureLayerTiling* AddTiling(float contents_scale);
157 void RemoveTiling(float contents_scale); 160 void RemoveTiling(float contents_scale);
158 void RemoveAllTilings(); 161 void RemoveAllTilings();
159 void SyncFromActiveLayer(const PictureLayerImpl* other); 162 void SyncFromActiveLayer(const PictureLayerImpl* other);
160 void AddTilingsForRasterScale(); 163 void AddTilingsForRasterScale();
161 void UpdateTilePriorities( 164 void UpdateTilePriorities(
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // A sanity state check to make sure UpdateTilePriorities only gets called 224 // A sanity state check to make sure UpdateTilePriorities only gets called
222 // after a CalculateContentsScale/ManageTilings. 225 // after a CalculateContentsScale/ManageTilings.
223 bool should_update_tile_priorities_; 226 bool should_update_tile_priorities_;
224 227
225 // Save a copy of the visible rect and viewport size of the last frame that 228 // Save a copy of the visible rect and viewport size of the last frame that
226 // has a valid viewport for prioritizing tiles. 229 // has a valid viewport for prioritizing tiles.
227 gfx::Rect visible_rect_for_tile_priority_; 230 gfx::Rect visible_rect_for_tile_priority_;
228 gfx::Rect viewport_rect_for_tile_priority_; 231 gfx::Rect viewport_rect_for_tile_priority_;
229 gfx::Transform screen_space_transform_for_tile_priority_; 232 gfx::Transform screen_space_transform_for_tile_priority_;
230 233
234 bool is_solid_color_;
235 SkColor solid_color_;
236
231 friend class PictureLayer; 237 friend class PictureLayer;
232 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); 238 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl);
233 }; 239 };
234 240
235 } // namespace cc 241 } // namespace cc
236 242
237 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ 243 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698