1 // Copyright 2012 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_PICTURE_PILE_H_
6 #define CC_RESOURCES_PICTURE_PILE_H_
8 #include "cc/resources/picture_pile_base.h"
9 #include "ui/gfx/rect.h"
12 class PicturePileImpl
;
14 class RenderingStatsInstrumentation
;
16 class CC_EXPORT PicturePile
: public PicturePileBase
{
20 // Re-record parts of the picture that are invalid.
21 // Invalidations are in layer space, and will be expanded to cover everything
22 // that was either recorded/changed or that has no recording, leaving out only
23 // pieces that we had a recording for and it was not changed.
24 // Return true iff the pile was modified.
25 bool UpdateAndExpandInvalidation(
26 ContentLayerClient
* painter
,
28 SkColor background_color
,
30 bool contents_fill_bounds_completely
,
31 const gfx::Size
& layer_size
,
32 const gfx::Rect
& visible_layer_rect
,
34 Picture::RecordingMode recording_mode
,
35 RenderingStatsInstrumentation
* stats_instrumentation
);
37 void SetEmptyBounds();
39 void set_slow_down_raster_scale_factor(int factor
) {
40 slow_down_raster_scale_factor_for_debug_
= factor
;
43 void set_show_debug_picture_borders(bool show
) {
44 show_debug_picture_borders_
= show
;
47 bool is_suitable_for_gpu_rasterization() const {
48 return is_suitable_for_gpu_rasterization_
;
50 void SetUnsuitableForGpuRasterizationForTesting() {
51 is_suitable_for_gpu_rasterization_
= false;
55 virtual ~PicturePile();
58 friend class PicturePileImpl
;
60 bool is_suitable_for_gpu_rasterization_
;
62 DISALLOW_COPY_AND_ASSIGN(PicturePile
);
67 #endif // CC_RESOURCES_PICTURE_PILE_H_