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

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: Remove ContentLayerClient* painter from UpdateAndExpandInvalidation and sync to head Created 4 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/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 30 matching lines...) Expand all
41 RECORD_WITH_CONSTRUCTION_DISABLED, 41 RECORD_WITH_CONSTRUCTION_DISABLED,
42 RECORD_WITH_SUBSEQUENCE_CACHING_DISABLED, 42 RECORD_WITH_SUBSEQUENCE_CACHING_DISABLED,
43 RECORDING_MODE_COUNT, // Must be the last entry. 43 RECORDING_MODE_COUNT, // Must be the last entry.
44 }; 44 };
45 45
46 RecordingSource(); 46 RecordingSource();
47 virtual ~RecordingSource(); 47 virtual ~RecordingSource();
48 48
49 void ToProtobuf(proto::RecordingSource* proto) const; 49 void ToProtobuf(proto::RecordingSource* proto) const;
50 void FromProtobuf(const proto::RecordingSource& proto, 50 void FromProtobuf(const proto::RecordingSource& proto,
51 ClientPictureCache* client_picture_cache, 51 const scoped_refptr<DisplayItemList>& display_list);
52 std::vector<uint32_t>* used_engine_picture_ids);
53 52
54 bool UpdateAndExpandInvalidation(ContentLayerClient* painter, 53 bool UpdateAndExpandInvalidation(Region* invalidation,
55 Region* invalidation,
56 const gfx::Size& layer_size, 54 const gfx::Size& layer_size,
57 int frame_number, 55 const gfx::Rect& new_recorded_viewport);
58 RecordingMode recording_mode); 56 void UpdateDisplayItemList(const scoped_refptr<DisplayItemList>& display_list,
57 const size_t& painter_reported_memory_usage);
59 gfx::Size GetSize() const; 58 gfx::Size GetSize() const;
60 void SetEmptyBounds(); 59 void SetEmptyBounds();
61 void SetSlowdownRasterScaleFactor(int factor); 60 void SetSlowdownRasterScaleFactor(int factor);
62 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); 61 void SetGenerateDiscardableImagesMetadata(bool generate_metadata);
63 void SetBackgroundColor(SkColor background_color); 62 void SetBackgroundColor(SkColor background_color);
64 void SetRequiresClear(bool requires_clear); 63 void SetRequiresClear(bool requires_clear);
65 64
66 void SetNeedsDisplayRect(const gfx::Rect& layer_rect); 65 void SetNeedsDisplayRect(const gfx::Rect& layer_rect);
67 66
68 // These functions are virtual for testing. 67 // These functions are virtual for testing.
69 virtual scoped_refptr<RasterSource> CreateRasterSource( 68 virtual scoped_refptr<RasterSource> CreateRasterSource(
70 bool can_use_lcd_text) const; 69 bool can_use_lcd_text) const;
71 virtual bool IsSuitableForGpuRasterization() const;
72
73 gfx::Rect recorded_viewport() const { return recorded_viewport_; }
74 70
75 const DisplayItemList* GetDisplayItemList(); 71 const DisplayItemList* GetDisplayItemList();
76 72
77 protected: 73 protected:
78 void Clear();
79
80 gfx::Rect recorded_viewport_; 74 gfx::Rect recorded_viewport_;
81 gfx::Size size_; 75 gfx::Size size_;
82 int slow_down_raster_scale_factor_for_debug_; 76 int slow_down_raster_scale_factor_for_debug_;
83 bool generate_discardable_images_metadata_; 77 bool generate_discardable_images_metadata_;
84 bool requires_clear_; 78 bool requires_clear_;
85 bool is_solid_color_; 79 bool is_solid_color_;
86 bool clear_canvas_with_debug_color_; 80 bool clear_canvas_with_debug_color_;
87 SkColor solid_color_; 81 SkColor solid_color_;
88 SkColor background_color_; 82 SkColor background_color_;
89
90 scoped_refptr<DisplayItemList> display_list_; 83 scoped_refptr<DisplayItemList> display_list_;
91 size_t painter_reported_memory_usage_; 84 size_t painter_reported_memory_usage_;
92 85
93 private: 86 private:
94 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, 87 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport,
95 const gfx::Rect& new_recorded_viewport, 88 const gfx::Rect& new_recorded_viewport,
96 Region* invalidation); 89 Region* invalidation);
90
97 void FinishDisplayItemListUpdate(); 91 void FinishDisplayItemListUpdate();
98 92
99 friend class RasterSource; 93 friend class RasterSource;
100 94
101 void DetermineIfSolidColor(); 95 void DetermineIfSolidColor();
102 96
103 InvalidationRegion invalidation_; 97 InvalidationRegion invalidation_;
104 98
105 DISALLOW_COPY_AND_ASSIGN(RecordingSource); 99 DISALLOW_COPY_AND_ASSIGN(RecordingSource);
106 }; 100 };
107 101
108 } // namespace cc 102 } // namespace cc
109 103
110 #endif // CC_PLAYBACK_RECORDING_SOURCE_H_ 104 #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