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

Side by Side Diff: cc/test/fake_recording_source.h

Issue 2678903003: cc: Clean up naming of paint-related identifiers (Closed)
Patch Set: Created 3 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_TEST_FAKE_RECORDING_SOURCE_H_ 5 #ifndef CC_TEST_FAKE_RECORDING_SOURCE_H_
6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_ 6 #define CC_TEST_FAKE_RECORDING_SOURCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 scoped_refptr<DisplayItemList> display_list = 71 scoped_refptr<DisplayItemList> display_list =
72 client_.PaintContentsToDisplayList( 72 client_.PaintContentsToDisplayList(
73 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL); 73 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL);
74 size_t painter_reported_memory_usage = 74 size_t painter_reported_memory_usage =
75 client_.GetApproximateUnsharedMemoryUsage(); 75 client_.GetApproximateUnsharedMemoryUsage();
76 UpdateAndExpandInvalidation(&invalidation, size_, new_recorded_viewport); 76 UpdateAndExpandInvalidation(&invalidation, size_, new_recorded_viewport);
77 UpdateDisplayItemList(display_list, painter_reported_memory_usage); 77 UpdateDisplayItemList(display_list, painter_reported_memory_usage);
78 } 78 }
79 79
80 void add_draw_rect(const gfx::Rect& rect) { 80 void add_draw_rect(const gfx::Rect& rect) {
81 client_.add_draw_rect(rect, default_paint_); 81 client_.add_draw_rect(rect, default_flags_);
82 } 82 }
83 83
84 void add_draw_rect_with_paint(const gfx::Rect& rect, 84 void add_draw_rect_with_flags(const gfx::Rect& rect,
85 const PaintFlags& paint) { 85 const PaintFlags& flags) {
86 client_.add_draw_rect(rect, paint); 86 client_.add_draw_rect(rect, flags);
87 } 87 }
88 88
89 void add_draw_rectf(const gfx::RectF& rect) { 89 void add_draw_rectf(const gfx::RectF& rect) {
90 client_.add_draw_rectf(rect, default_paint_); 90 client_.add_draw_rectf(rect, default_flags_);
91 } 91 }
92 92
93 void add_draw_rectf_with_paint(const gfx::RectF& rect, 93 void add_draw_rectf_with_flags(const gfx::RectF& rect,
94 const PaintFlags& paint) { 94 const PaintFlags& flags) {
95 client_.add_draw_rectf(rect, paint); 95 client_.add_draw_rectf(rect, flags);
96 } 96 }
97 97
98 void add_draw_image(sk_sp<const SkImage> image, const gfx::Point& point) { 98 void add_draw_image(sk_sp<const SkImage> image, const gfx::Point& point) {
99 client_.add_draw_image(std::move(image), point, default_paint_); 99 client_.add_draw_image(std::move(image), point, default_flags_);
100 } 100 }
101 101
102 void add_draw_image_with_transform(sk_sp<const SkImage> image, 102 void add_draw_image_with_transform(sk_sp<const SkImage> image,
103 const gfx::Transform& transform) { 103 const gfx::Transform& transform) {
104 client_.add_draw_image_with_transform(std::move(image), transform, 104 client_.add_draw_image_with_transform(std::move(image), transform,
105 default_paint_); 105 default_flags_);
106 } 106 }
107 107
108 void add_draw_image_with_paint(sk_sp<const SkImage> image, 108 void add_draw_image_with_flags(sk_sp<const SkImage> image,
109 const gfx::Point& point, 109 const gfx::Point& point,
110 const PaintFlags& paint) { 110 const PaintFlags& flags) {
111 client_.add_draw_image(std::move(image), point, paint); 111 client_.add_draw_image(std::move(image), point, flags);
112 } 112 }
113 113
114 void set_default_paint(const PaintFlags& paint) { default_paint_ = paint; } 114 void set_default_flags(const PaintFlags& flags) { default_flags_ = flags; }
115 115
116 void set_reported_memory_usage(size_t reported_memory_usage) { 116 void set_reported_memory_usage(size_t reported_memory_usage) {
117 client_.set_reported_memory_usage(reported_memory_usage); 117 client_.set_reported_memory_usage(reported_memory_usage);
118 } 118 }
119 119
120 void reset_draws() { 120 void reset_draws() {
121 client_ = FakeContentLayerClient(); 121 client_ = FakeContentLayerClient();
122 client_.set_bounds(size_); 122 client_.set_bounds(size_);
123 } 123 }
124 124
125 void SetPlaybackAllowedEvent(base::WaitableEvent* event) { 125 void SetPlaybackAllowedEvent(base::WaitableEvent* event) {
126 playback_allowed_event_ = event; 126 playback_allowed_event_ = event;
127 } 127 }
128 128
129 // Checks that the basic properties of the |other| match |this|. For the 129 // Checks that the basic properties of the |other| match |this|. For the
130 // DisplayItemList, it checks that the painted result matches the painted 130 // DisplayItemList, it checks that the painted result matches the painted
131 // result of |other|. 131 // result of |other|.
132 bool EqualsTo(const FakeRecordingSource& other); 132 bool EqualsTo(const FakeRecordingSource& other);
133 133
134 private: 134 private:
135 FakeContentLayerClient client_; 135 FakeContentLayerClient client_;
136 PaintFlags default_paint_; 136 PaintFlags default_flags_;
137 base::WaitableEvent* playback_allowed_event_; 137 base::WaitableEvent* playback_allowed_event_;
138 }; 138 };
139 139
140 } // namespace cc 140 } // namespace cc
141 141
142 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_ 142 #endif // CC_TEST_FAKE_RECORDING_SOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698