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

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

Issue 1512823002: Serialize DisplayListRecordingSource to protos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years 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/display_item_list_unittest.cc ('k') | cc/playback/display_list_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_DISPLAY_LIST_RECORDING_SOURCE_H_ 5 #ifndef CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_
6 #define CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ 6 #define CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "cc/base/cc_export.h" 10 #include "cc/base/cc_export.h"
11 #include "third_party/skia/include/core/SkColor.h" 11 #include "third_party/skia/include/core/SkColor.h"
12 #include "ui/gfx/geometry/rect.h" 12 #include "ui/gfx/geometry/rect.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 14
15 namespace cc { 15 namespace cc {
16
17 namespace proto {
18 class DisplayListRecordingSource;
19 }
20
16 class ContentLayerClient; 21 class ContentLayerClient;
17 class DisplayItemList; 22 class DisplayItemList;
18 class DisplayListRasterSource; 23 class DisplayListRasterSource;
19 class Region; 24 class Region;
20 25
21 class CC_EXPORT DisplayListRecordingSource { 26 class CC_EXPORT DisplayListRecordingSource {
22 public: 27 public:
23 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer 28 // TODO(schenney) Remove RECORD_WITH_SK_NULL_CANVAS when we no longer
24 // support a non-Slimming Paint path. 29 // support a non-Slimming Paint path.
25 enum RecordingMode { 30 enum RecordingMode {
26 RECORD_NORMALLY, 31 RECORD_NORMALLY,
27 RECORD_WITH_SK_NULL_CANVAS, 32 RECORD_WITH_SK_NULL_CANVAS,
28 RECORD_WITH_PAINTING_DISABLED, 33 RECORD_WITH_PAINTING_DISABLED,
29 RECORD_WITH_CACHING_DISABLED, 34 RECORD_WITH_CACHING_DISABLED,
30 RECORD_WITH_CONSTRUCTION_DISABLED, 35 RECORD_WITH_CONSTRUCTION_DISABLED,
31 RECORDING_MODE_COUNT, // Must be the last entry. 36 RECORDING_MODE_COUNT, // Must be the last entry.
32 }; 37 };
33 38
34 DisplayListRecordingSource(); 39 DisplayListRecordingSource();
35 virtual ~DisplayListRecordingSource(); 40 virtual ~DisplayListRecordingSource();
36 41
42 void ToProtobuf(proto::DisplayListRecordingSource* proto) const;
43 void FromProtobuf(const proto::DisplayListRecordingSource& proto);
44
37 bool UpdateAndExpandInvalidation(ContentLayerClient* painter, 45 bool UpdateAndExpandInvalidation(ContentLayerClient* painter,
38 Region* invalidation, 46 Region* invalidation,
39 const gfx::Size& layer_size, 47 const gfx::Size& layer_size,
40 const gfx::Rect& visible_layer_rect, 48 const gfx::Rect& visible_layer_rect,
41 int frame_number, 49 int frame_number,
42 RecordingMode recording_mode); 50 RecordingMode recording_mode);
43 gfx::Size GetSize() const; 51 gfx::Size GetSize() const;
44 void SetEmptyBounds(); 52 void SetEmptyBounds();
45 void SetSlowdownRasterScaleFactor(int factor); 53 void SetSlowdownRasterScaleFactor(int factor);
46 void SetGenerateDiscardableImagesMetadata(bool generate_metadata); 54 void SetGenerateDiscardableImagesMetadata(bool generate_metadata);
(...skipping 20 matching lines...) Expand all
67 SkColor solid_color_; 75 SkColor solid_color_;
68 SkColor background_color_; 76 SkColor background_color_;
69 77
70 scoped_refptr<DisplayItemList> display_list_; 78 scoped_refptr<DisplayItemList> display_list_;
71 size_t painter_reported_memory_usage_; 79 size_t painter_reported_memory_usage_;
72 80
73 private: 81 private:
74 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport, 82 void UpdateInvalidationForNewViewport(const gfx::Rect& old_recorded_viewport,
75 const gfx::Rect& new_recorded_viewport, 83 const gfx::Rect& new_recorded_viewport,
76 Region* invalidation); 84 Region* invalidation);
85 void FinishDisplayItemListUpdate();
77 86
78 friend class DisplayListRasterSource; 87 friend class DisplayListRasterSource;
79 88
80 void DetermineIfSolidColor(); 89 void DetermineIfSolidColor();
81 90
82 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource); 91 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource);
83 }; 92 };
84 93
85 } // namespace cc 94 } // namespace cc
86 95
87 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_ 96 #endif // CC_PLAYBACK_DISPLAY_LIST_RECORDING_SOURCE_H_
OLDNEW
« no previous file with comments | « cc/playback/display_item_list_unittest.cc ('k') | cc/playback/display_list_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698