Revert 268405 "Make sure that ScratchBuffer::Allocate() always r..."
[chromium-blink-merge.git] / cc / resources / picture_pile.h
blobdbc3966b88ab7caecc2bd24e044884b591f8a703
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"
11 namespace cc {
12 class PicturePileImpl;
13 class Region;
14 class RenderingStatsInstrumentation;
16 class CC_EXPORT PicturePile : public PicturePileBase {
17 public:
18 PicturePile();
20 // Re-record parts of the picture that are invalid.
21 // Invalidations are in layer space.
22 // Return true iff the pile was modified.
23 bool Update(ContentLayerClient* painter,
24 SkColor background_color,
25 bool contents_opaque,
26 bool contents_fill_bounds_completely,
27 const Region& invalidation,
28 const gfx::Rect& visible_layer_rect,
29 int frame_number,
30 RenderingStatsInstrumentation* stats_instrumentation);
32 void set_slow_down_raster_scale_factor(int factor) {
33 slow_down_raster_scale_factor_for_debug_ = factor;
36 void set_show_debug_picture_borders(bool show) {
37 show_debug_picture_borders_ = show;
40 bool is_suitable_for_gpu_rasterization() const {
41 return is_suitable_for_gpu_rasterization_;
43 void SetUnsuitableForGpuRasterizationForTesting() {
44 is_suitable_for_gpu_rasterization_ = false;
47 protected:
48 virtual ~PicturePile();
50 private:
51 friend class PicturePileImpl;
53 bool is_suitable_for_gpu_rasterization_;
55 DISALLOW_COPY_AND_ASSIGN(PicturePile);
58 } // namespace cc
60 #endif // CC_RESOURCES_PICTURE_PILE_H_