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
3 // found in the LICENSE file.
5 #ifndef CC_RESOURCES_DISPLAY_LIST_RECORDING_SOURCE_H_
6 #define CC_RESOURCES_DISPLAY_LIST_RECORDING_SOURCE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/resources/recording_source.h"
12 class DisplayItemList
;
13 class DisplayListRasterSource
;
15 class CC_EXPORT DisplayListRecordingSource
: public RecordingSource
{
17 DisplayListRecordingSource();
18 ~DisplayListRecordingSource() override
;
20 // RecordingSource overrides.
21 bool UpdateAndExpandInvalidation(
22 ContentLayerClient
* painter
,
24 bool can_use_lcd_text
,
25 const gfx::Size
& layer_size
,
26 const gfx::Rect
& visible_layer_rect
,
28 Picture::RecordingMode recording_mode
) override
;
29 scoped_refptr
<RasterSource
> CreateRasterSource() const override
;
30 gfx::Size
GetSize() const final
;
31 void SetEmptyBounds() override
;
32 void SetMinContentsScale(float min_contents_scale
) override
;
33 void SetSlowdownRasterScaleFactor(int factor
) override
;
34 bool IsSuitableForGpuRasterization() const override
;
35 void SetTileGridSize(const gfx::Size
& tile_grid_size
) override
;
36 void SetUnsuitableForGpuRasterizationForTesting() override
;
37 SkTileGridFactory::TileGridInfo
GetTileGridInfoForTesting() const override
;
42 gfx::Rect recorded_viewport_
;
44 int slow_down_raster_scale_factor_for_debug_
;
45 bool can_use_lcd_text_
;
48 int pixel_record_distance_
;
50 scoped_refptr
<DisplayItemList
> display_list_
;
53 friend class DisplayListRasterSource
;
55 void DetermineIfSolidColor();
57 bool is_suitable_for_gpu_rasterization_
;
59 DISALLOW_COPY_AND_ASSIGN(DisplayListRecordingSource
);
64 #endif // CC_RESOURCES_DISPLAY_LIST_RECORDING_SOURCE_H_