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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 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
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/recording_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_RECORDING_SOURCE_H_ 5 #ifndef CC_LAYERS_RECORDING_SOURCE_H_
6 #define CC_LAYERS_RECORDING_SOURCE_H_ 6 #define CC_LAYERS_RECORDING_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void UpdateDisplayItemList(const scoped_refptr<DisplayItemList>& display_list, 44 void UpdateDisplayItemList(const scoped_refptr<DisplayItemList>& display_list,
45 const size_t& painter_reported_memory_usage); 45 const size_t& painter_reported_memory_usage);
46 gfx::Size GetSize() const; 46 gfx::Size GetSize() const;
47 void SetEmptyBounds(); 47 void SetEmptyBounds();
48 void SetSlowdownRasterScaleFactor(int factor); 48 void SetSlowdownRasterScaleFactor(int factor);
49 void SetBackgroundColor(SkColor background_color); 49 void SetBackgroundColor(SkColor background_color);
50 void SetRequiresClear(bool requires_clear); 50 void SetRequiresClear(bool requires_clear);
51 51
52 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); 52 void SetNeedsDisplayRect(const gfx::Rect& layer_rect);
53 53
54 void SetRecordingScaleFactor(float recording_scale_factor);
55
54 // These functions are virtual for testing. 56 // These functions are virtual for testing.
55 virtual scoped_refptr<RasterSource> CreateRasterSource() const; 57 virtual scoped_refptr<RasterSource> CreateRasterSource() const;
56 58
57 const DisplayItemList* GetDisplayItemList(); 59 const DisplayItemList* GetDisplayItemList();
58 gfx::Rect recorded_viewport() const { return recorded_viewport_; } 60 gfx::Rect recorded_viewport() const { return recorded_viewport_; }
59 61
60 protected: 62 protected:
61 gfx::Rect recorded_viewport_; 63 gfx::Rect recorded_viewport_;
62 gfx::Size size_; 64 gfx::Size size_;
63 int slow_down_raster_scale_factor_for_debug_; 65 int slow_down_raster_scale_factor_for_debug_;
64 bool requires_clear_; 66 bool requires_clear_;
65 bool is_solid_color_; 67 bool is_solid_color_;
66 bool clear_canvas_with_debug_color_; 68 bool clear_canvas_with_debug_color_;
67 SkColor solid_color_; 69 SkColor solid_color_;
68 SkColor background_color_; 70 SkColor background_color_;
69 scoped_refptr<DisplayItemList> display_list_; 71 scoped_refptr<DisplayItemList> display_list_;
70 size_t painter_reported_memory_usage_; 72 size_t painter_reported_memory_usage_;
73 float recording_scale_factor_;
71 74
72 private: 75 private:
73 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, 76 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport,
74 const gfx::Rect& new_recorded_viewport, 77 const gfx::Rect& new_recorded_viewport,
75 Region* invalidation); 78 Region* invalidation);
76 79
77 void FinishDisplayItemListUpdate(); 80 void FinishDisplayItemListUpdate();
78 81
79 friend class RasterSource; 82 friend class RasterSource;
80 83
81 void DetermineIfSolidColor(); 84 void DetermineIfSolidColor();
82 85
83 InvalidationRegion invalidation_; 86 InvalidationRegion invalidation_;
84 87
85 DISALLOW_COPY_AND_ASSIGN(RecordingSource); 88 DISALLOW_COPY_AND_ASSIGN(RecordingSource);
86 }; 89 };
87 90
88 } // namespace cc 91 } // namespace cc
89 92
90 #endif // CC_LAYERS_RECORDING_SOURCE_H_ 93 #endif // CC_LAYERS_RECORDING_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/layers/recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698