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

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

Issue 2084313002: Use alpha rather than inset rect for FakeRasterSource::CreateFilled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_raster_source.h" 5 #include "cc/test/fake_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_recording_source.h" 10 #include "cc/test/fake_recording_source.h"
(...skipping 10 matching lines...) Expand all
21 21
22 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilled( 22 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilled(
23 const gfx::Size& size) { 23 const gfx::Size& size) {
24 auto recording_source = 24 auto recording_source =
25 FakeRecordingSource::CreateFilledRecordingSource(size); 25 FakeRecordingSource::CreateFilledRecordingSource(size);
26 26
27 SkPaint red_paint; 27 SkPaint red_paint;
28 red_paint.setColor(SK_ColorRED); 28 red_paint.setColor(SK_ColorRED);
29 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint); 29 recording_source->add_draw_rect_with_paint(gfx::Rect(size), red_paint);
30 30
31 gfx::Size smaller_size(size.width() - 10, size.height() - 10); 31 SkPaint salmon_pink_paint;
32 SkPaint green_paint; 32 salmon_pink_paint.setColor(SK_ColorRED);
33 green_paint.setColor(SK_ColorGREEN); 33 salmon_pink_paint.setAlpha(128);
34 recording_source->add_draw_rect_with_paint(gfx::Rect(smaller_size), 34 recording_source->add_draw_rect_with_paint(gfx::Rect(size),
35 green_paint); 35 salmon_pink_paint);
36 36
37 recording_source->Rerecord(); 37 recording_source->Rerecord();
38 38
39 return make_scoped_refptr( 39 return make_scoped_refptr(
40 new FakeRasterSource(recording_source.get(), false)); 40 new FakeRasterSource(recording_source.get(), false));
41 } 41 }
42 42
43 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilledLCD( 43 scoped_refptr<FakeRasterSource> FakeRasterSource::CreateFilledLCD(
44 const gfx::Size& size) { 44 const gfx::Size& size) {
45 auto recording_source = 45 auto recording_source =
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 float contents_scale, 145 float contents_scale,
146 const PlaybackSettings& settings) const { 146 const PlaybackSettings& settings) const {
147 if (playback_allowed_event_) 147 if (playback_allowed_event_)
148 playback_allowed_event_->Wait(); 148 playback_allowed_event_->Wait();
149 RasterSource::PlaybackToCanvas(canvas, canvas_bitmap_rect, 149 RasterSource::PlaybackToCanvas(canvas, canvas_bitmap_rect,
150 canvas_playback_rect, contents_scale, 150 canvas_playback_rect, contents_scale,
151 settings); 151 settings);
152 } 152 }
153 153
154 } // namespace cc 154 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698