| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ | 5 #ifndef CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
| 6 #define CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ | 6 #define CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 FakeContentLayerClient(); | 38 FakeContentLayerClient(); |
| 39 ~FakeContentLayerClient() override; | 39 ~FakeContentLayerClient() override; |
| 40 | 40 |
| 41 gfx::Rect PaintableRegion() override; | 41 gfx::Rect PaintableRegion() override; |
| 42 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | 42 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
| 43 PaintingControlSetting painting_control) override; | 43 PaintingControlSetting painting_control) override; |
| 44 bool FillsBoundsCompletely() const override; | 44 bool FillsBoundsCompletely() const override; |
| 45 size_t GetApproximateUnsharedMemoryUsage() const override; | 45 size_t GetApproximateUnsharedMemoryUsage() const override; |
| 46 | 46 |
| 47 void set_display_list_use_cached_picture(bool use_cached_picture) { |
| 48 display_list_use_cached_picture_ = use_cached_picture; |
| 49 } |
| 50 |
| 47 void set_fill_with_nonsolid_color(bool nonsolid) { | 51 void set_fill_with_nonsolid_color(bool nonsolid) { |
| 48 fill_with_nonsolid_color_ = nonsolid; | 52 fill_with_nonsolid_color_ = nonsolid; |
| 49 } | 53 } |
| 50 | 54 |
| 51 void add_draw_rect(const gfx::Rect& rect, const SkPaint& paint) { | 55 void add_draw_rect(const gfx::Rect& rect, const SkPaint& paint) { |
| 52 draw_rects_.push_back(std::make_pair(gfx::RectF(rect), paint)); | 56 draw_rects_.push_back(std::make_pair(gfx::RectF(rect), paint)); |
| 53 } | 57 } |
| 54 | 58 |
| 55 void add_draw_rectf(const gfx::RectF& rect, const SkPaint& paint) { | 59 void add_draw_rectf(const gfx::RectF& rect, const SkPaint& paint) { |
| 56 draw_rects_.push_back(std::make_pair(rect, paint)); | 60 draw_rects_.push_back(std::make_pair(rect, paint)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 82 | 86 |
| 83 void set_bounds(gfx::Size bounds) { | 87 void set_bounds(gfx::Size bounds) { |
| 84 bounds_ = bounds; | 88 bounds_ = bounds; |
| 85 bounds_set_ = true; | 89 bounds_set_ = true; |
| 86 } | 90 } |
| 87 | 91 |
| 88 private: | 92 private: |
| 89 typedef std::vector<std::pair<gfx::RectF, SkPaint>> RectPaintVector; | 93 typedef std::vector<std::pair<gfx::RectF, SkPaint>> RectPaintVector; |
| 90 typedef std::vector<ImageData> ImageVector; | 94 typedef std::vector<ImageData> ImageVector; |
| 91 | 95 |
| 96 bool display_list_use_cached_picture_; |
| 92 bool fill_with_nonsolid_color_; | 97 bool fill_with_nonsolid_color_; |
| 93 RectPaintVector draw_rects_; | 98 RectPaintVector draw_rects_; |
| 94 ImageVector draw_images_; | 99 ImageVector draw_images_; |
| 95 SkCanvas* last_canvas_; | 100 SkCanvas* last_canvas_; |
| 96 PaintingControlSetting last_painting_control_; | 101 PaintingControlSetting last_painting_control_; |
| 97 size_t reported_memory_usage_; | 102 size_t reported_memory_usage_; |
| 98 gfx::Size bounds_; | 103 gfx::Size bounds_; |
| 99 bool bounds_set_; | 104 bool bounds_set_; |
| 100 }; | 105 }; |
| 101 | 106 |
| 102 } // namespace cc | 107 } // namespace cc |
| 103 | 108 |
| 104 #endif // CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ | 109 #endif // CC_TEST_FAKE_CONTENT_LAYER_CLIENT_H_ |
| OLD | NEW |