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

Side by Side Diff: cc/test/fake_display_list_raster_source.cc

Issue 1365793003: cc: Re-enable disabled tile manager unittests (plus fixes) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 #include "cc/test/fake_display_list_raster_source.h" 5 #include "cc/test/fake_display_list_raster_source.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "cc/test/fake_display_list_recording_source.h" 10 #include "cc/test/fake_display_list_recording_source.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 bool can_use_lcd, 126 bool can_use_lcd,
127 base::WaitableEvent* playback_allowed_event) { 127 base::WaitableEvent* playback_allowed_event) {
128 return make_scoped_refptr(new FakeDisplayListRasterSource( 128 return make_scoped_refptr(new FakeDisplayListRasterSource(
129 recording_source, can_use_lcd, playback_allowed_event)); 129 recording_source, can_use_lcd, playback_allowed_event));
130 } 130 }
131 131
132 FakeDisplayListRasterSource::FakeDisplayListRasterSource( 132 FakeDisplayListRasterSource::FakeDisplayListRasterSource(
133 const DisplayListRecordingSource* recording_source, 133 const DisplayListRecordingSource* recording_source,
134 bool can_use_lcd) 134 bool can_use_lcd)
135 : DisplayListRasterSource(recording_source, can_use_lcd), 135 : DisplayListRasterSource(recording_source, can_use_lcd),
136 is_solid_color_(false),
137 is_solid_color_overridden_(false),
136 playback_allowed_event_(nullptr) {} 138 playback_allowed_event_(nullptr) {}
137 139
138 FakeDisplayListRasterSource::FakeDisplayListRasterSource( 140 FakeDisplayListRasterSource::FakeDisplayListRasterSource(
139 const DisplayListRecordingSource* recording_source, 141 const DisplayListRecordingSource* recording_source,
140 bool can_use_lcd, 142 bool can_use_lcd,
141 base::WaitableEvent* playback_allowed_event) 143 base::WaitableEvent* playback_allowed_event)
142 : DisplayListRasterSource(recording_source, can_use_lcd), 144 : DisplayListRasterSource(recording_source, can_use_lcd),
145 is_solid_color_(false),
146 is_solid_color_overridden_(false),
143 playback_allowed_event_(playback_allowed_event) {} 147 playback_allowed_event_(playback_allowed_event) {}
144 148
145 FakeDisplayListRasterSource::~FakeDisplayListRasterSource() {} 149 FakeDisplayListRasterSource::~FakeDisplayListRasterSource() {}
146 150
147 void FakeDisplayListRasterSource::PlaybackToCanvas( 151 void FakeDisplayListRasterSource::PlaybackToCanvas(
148 SkCanvas* canvas, 152 SkCanvas* canvas,
149 const gfx::Rect& canvas_bitmap_rect, 153 const gfx::Rect& canvas_bitmap_rect,
150 const gfx::Rect& canvas_playback_rect, 154 const gfx::Rect& canvas_playback_rect,
151 float contents_scale) const { 155 float contents_scale) const {
152 if (playback_allowed_event_) 156 if (playback_allowed_event_)
153 playback_allowed_event_->Wait(); 157 playback_allowed_event_->Wait();
154 DisplayListRasterSource::PlaybackToCanvas( 158 DisplayListRasterSource::PlaybackToCanvas(
155 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale); 159 canvas, canvas_bitmap_rect, canvas_playback_rect, contents_scale);
156 } 160 }
157 161
162 bool FakeDisplayListRasterSource::IsSolidColor() const {
163 return is_solid_color_overridden_ ? is_solid_color_
164 : DisplayListRasterSource::IsSolidColor();
165 }
166
158 } // namespace cc 167 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698