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

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

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/playback/raster_source.cc ('k') | cc/playback/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_PLAYBACK_RECORDING_SOURCE_H_ 5 #ifndef CC_PLAYBACK_RECORDING_SOURCE_H_
6 #define CC_PLAYBACK_RECORDING_SOURCE_H_ 6 #define CC_PLAYBACK_RECORDING_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void SetBackgroundColor(SkColor background_color); 63 void SetBackgroundColor(SkColor background_color);
64 void SetRequiresClear(bool requires_clear); 64 void SetRequiresClear(bool requires_clear);
65 65
66 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); 66 void SetNeedsDisplayRect(const gfx::Rect& layer_rect);
67 67
68 // These functions are virtual for testing. 68 // These functions are virtual for testing.
69 virtual scoped_refptr<RasterSource> CreateRasterSource( 69 virtual scoped_refptr<RasterSource> CreateRasterSource(
70 bool can_use_lcd_text) const; 70 bool can_use_lcd_text) const;
71 virtual bool IsSuitableForGpuRasterization() const; 71 virtual bool IsSuitableForGpuRasterization() const;
72 72
73 gfx::Rect recorded_viewport() const { return recorded_viewport_; } 73 gfx::Rect recorded_viewport() const { return inputs_.recorded_viewport; }
74 74
75 const DisplayItemList* GetDisplayItemList(); 75 const DisplayItemList* GetDisplayItemList();
76 76
77 protected: 77 protected:
78 void Clear(); 78 void Clear();
79 79
80 gfx::Rect recorded_viewport_;
81 gfx::Size size_; 80 gfx::Size size_;
82 int slow_down_raster_scale_factor_for_debug_; 81 int slow_down_raster_scale_factor_for_debug_;
83 bool generate_discardable_images_metadata_; 82 bool generate_discardable_images_metadata_;
84 bool requires_clear_; 83 bool requires_clear_;
85 bool is_solid_color_; 84 bool is_solid_color_;
86 bool clear_canvas_with_debug_color_; 85 bool clear_canvas_with_debug_color_;
87 SkColor solid_color_; 86 SkColor solid_color_;
88 SkColor background_color_; 87 SkColor background_color_;
89 88
90 scoped_refptr<DisplayItemList> display_list_; 89 // Encapsulates all data received from the ContentLayerClient.
91 size_t painter_reported_memory_usage_; 90 struct Inputs {
91 Inputs();
Khushal 2016/07/12 23:28:19 You can inline the initialization and remove the c
Menglin 2016/07/12 23:36:47 that's what i did but got the "Complex class/struc
danakj 2016/07/12 23:39:42 Then you can inline the initialization and just =
92 ~Inputs();
93
94 gfx::Rect recorded_viewport;
95 scoped_refptr<DisplayItemList> display_list;
96 size_t painter_reported_memory_usage;
97 };
98
99 Inputs inputs_;
92 100
93 private: 101 private:
94 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, 102 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport,
95 const gfx::Rect& new_recorded_viewport, 103 const gfx::Rect& new_recorded_viewport,
96 Region* invalidation); 104 Region* invalidation);
97 void FinishDisplayItemListUpdate(); 105 void FinishDisplayItemListUpdate();
98 106
99 friend class RasterSource; 107 friend class RasterSource;
100 108
101 void DetermineIfSolidColor(); 109 void DetermineIfSolidColor();
102 110
103 InvalidationRegion invalidation_; 111 InvalidationRegion invalidation_;
104 112
105 DISALLOW_COPY_AND_ASSIGN(RecordingSource); 113 DISALLOW_COPY_AND_ASSIGN(RecordingSource);
106 }; 114 };
107 115
108 } // namespace cc 116 } // namespace cc
109 117
110 #endif // CC_PLAYBACK_RECORDING_SOURCE_H_ 118 #endif // CC_PLAYBACK_RECORDING_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/playback/raster_source.cc ('k') | cc/playback/recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698