Update mojo surfaces bindings and mojo/cc/ glue
[chromium-blink-merge.git] / cc / resources / picture_pile.h
blob4b6119297622e05929e79ab5298b8cb0c259cc22
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, 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,
27 Region* invalidation,
28 SkColor background_color,
29 bool contents_opaque,
30 bool contents_fill_bounds_completely,
31 const gfx::Size& layer_size,
32 const gfx::Rect& visible_layer_rect,
33 int frame_number,
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;
54 protected:
55 virtual ~PicturePile();
57 private:
58 friend class PicturePileImpl;
60 bool is_suitable_for_gpu_rasterization_;
62 DISALLOW_COPY_AND_ASSIGN(PicturePile);
65 } // namespace cc
67 #endif // CC_RESOURCES_PICTURE_PILE_H_