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

Side by Side Diff: cc/playback/raster_source.cc

Issue 2141233002: cc: Clean up RecordingSource API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 5 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 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 #include "cc/playback/raster_source.h" 5 #include "cc/playback/raster_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/base/region.h" 10 #include "cc/base/region.h"
11 #include "cc/debug/debug_colors.h" 11 #include "cc/debug/debug_colors.h"
12 #include "cc/playback/display_item_list.h" 12 #include "cc/playback/display_item_list.h"
13 #include "cc/playback/image_hijack_canvas.h" 13 #include "cc/playback/image_hijack_canvas.h"
14 #include "cc/playback/skip_image_canvas.h" 14 #include "cc/playback/skip_image_canvas.h"
15 #include "skia/ext/analysis_canvas.h" 15 #include "skia/ext/analysis_canvas.h"
16 #include "third_party/skia/include/core/SkCanvas.h" 16 #include "third_party/skia/include/core/SkCanvas.h"
17 #include "third_party/skia/include/core/SkClipStack.h" 17 #include "third_party/skia/include/core/SkClipStack.h"
18 #include "third_party/skia/include/core/SkPictureRecorder.h" 18 #include "third_party/skia/include/core/SkPictureRecorder.h"
19 #include "ui/gfx/geometry/rect_conversions.h" 19 #include "ui/gfx/geometry/rect_conversions.h"
20 20
21 namespace cc { 21 namespace cc {
22 22
23 scoped_refptr<RasterSource> RasterSource::CreateFromRecordingSource( 23 scoped_refptr<RasterSource> RasterSource::CreateFromDataStruct(
24 const RecordingSource* other, 24 const PictureLayerData& layer_data,
25 const ContentLayerClientData& client_data,
25 bool can_use_lcd_text) { 26 bool can_use_lcd_text) {
26 return make_scoped_refptr(new RasterSource(other, can_use_lcd_text)); 27 return make_scoped_refptr(
28 new RasterSource(layer_data, client_data, can_use_lcd_text));
27 } 29 }
28 30
29 RasterSource::RasterSource(const RecordingSource* other, bool can_use_lcd_text) 31 RasterSource::RasterSource(const PictureLayerData& layer_data,
30 : display_list_(other->display_list_), 32 const ContentLayerClientData& client_data,
31 painter_reported_memory_usage_(other->painter_reported_memory_usage_), 33 bool can_use_lcd_text)
32 background_color_(other->background_color_), 34 : display_list_(client_data.display_list),
33 requires_clear_(other->requires_clear_), 35 painter_reported_memory_usage_(client_data.painter_reported_memory_usage),
36 background_color_(layer_data.background_color),
37 requires_clear_(layer_data.requires_clear),
34 can_use_lcd_text_(can_use_lcd_text), 38 can_use_lcd_text_(can_use_lcd_text),
35 is_solid_color_(other->is_solid_color_), 39 is_solid_color_(layer_data.is_solid_color),
36 solid_color_(other->solid_color_), 40 solid_color_(layer_data.solid_color),
37 recorded_viewport_(other->recorded_viewport_), 41 recorded_viewport_(client_data.recorded_viewport),
38 size_(other->size_), 42 size_(layer_data.size),
39 clear_canvas_with_debug_color_(other->clear_canvas_with_debug_color_), 43 clear_canvas_with_debug_color_(layer_data.clear_canvas_with_debug_color),
40 slow_down_raster_scale_factor_for_debug_( 44 slow_down_raster_scale_factor_for_debug_(
41 other->slow_down_raster_scale_factor_for_debug_), 45 layer_data.slow_down_raster_scale_factor_for_debug),
42 should_attempt_to_use_distance_field_text_(false), 46 should_attempt_to_use_distance_field_text_(false),
43 image_decode_controller_(nullptr) { 47 image_decode_controller_(nullptr) {}
44 }
45 48
46 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text) 49 RasterSource::RasterSource(const RasterSource* other, bool can_use_lcd_text)
47 : display_list_(other->display_list_), 50 : display_list_(other->display_list_),
48 painter_reported_memory_usage_(other->painter_reported_memory_usage_), 51 painter_reported_memory_usage_(other->painter_reported_memory_usage_),
49 background_color_(other->background_color_), 52 background_color_(other->background_color_),
50 requires_clear_(other->requires_clear_), 53 requires_clear_(other->requires_clear_),
51 can_use_lcd_text_(can_use_lcd_text), 54 can_use_lcd_text_(can_use_lcd_text),
52 is_solid_color_(other->is_solid_color_), 55 is_solid_color_(other->is_solid_color_),
53 solid_color_(other->solid_color_), 56 solid_color_(other->solid_color_),
54 recorded_viewport_(other->recorded_viewport_), 57 recorded_viewport_(other->recorded_viewport_),
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 DCHECK(image_decode_controller); 304 DCHECK(image_decode_controller);
302 image_decode_controller_ = image_decode_controller; 305 image_decode_controller_ = image_decode_controller;
303 } 306 }
304 307
305 RasterSource::PlaybackSettings::PlaybackSettings() 308 RasterSource::PlaybackSettings::PlaybackSettings()
306 : playback_to_shared_canvas(false), 309 : playback_to_shared_canvas(false),
307 skip_images(false), 310 skip_images(false),
308 use_image_hijack_canvas(true) {} 311 use_image_hijack_canvas(true) {}
309 312
310 } // namespace cc 313 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698