OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_PLAYBACK_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_ITEM_H_ |
6 #define CC_PLAYBACK_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_DISPLAY_ITEM_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 is_suitable_for_gpu_rasterization_ = is_suitable_for_gpu_rasterization; | 29 is_suitable_for_gpu_rasterization_ = is_suitable_for_gpu_rasterization; |
30 approximate_op_count_ = approximate_op_count; | 30 approximate_op_count_ = approximate_op_count; |
31 external_memory_usage_ = external_memory_usage; | 31 external_memory_usage_ = external_memory_usage; |
32 } | 32 } |
33 | 33 |
34 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; | 34 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; |
35 virtual void FromProtobuf(const proto::DisplayItem& proto) = 0; | 35 virtual void FromProtobuf(const proto::DisplayItem& proto) = 0; |
36 virtual void Raster(SkCanvas* canvas, | 36 virtual void Raster(SkCanvas* canvas, |
37 const gfx::Rect& canvas_target_playback_rect, | 37 const gfx::Rect& canvas_target_playback_rect, |
38 SkPicture::AbortCallback* callback) const = 0; | 38 SkPicture::AbortCallback* callback) const = 0; |
39 virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0; | 39 virtual void AsValueInto(const gfx::Rect& visual_rect, |
| 40 base::trace_event::TracedValue* array) const = 0; |
40 | 41 |
41 bool is_suitable_for_gpu_rasterization() const { | 42 bool is_suitable_for_gpu_rasterization() const { |
42 return is_suitable_for_gpu_rasterization_; | 43 return is_suitable_for_gpu_rasterization_; |
43 } | 44 } |
44 int approximate_op_count() const { return approximate_op_count_; } | 45 int approximate_op_count() const { return approximate_op_count_; } |
45 size_t external_memory_usage() const { return external_memory_usage_; } | 46 size_t external_memory_usage() const { return external_memory_usage_; } |
46 | 47 |
47 protected: | 48 protected: |
48 DisplayItem(); | 49 DisplayItem(); |
49 | 50 |
50 bool is_suitable_for_gpu_rasterization_; | 51 bool is_suitable_for_gpu_rasterization_; |
51 int approximate_op_count_; | 52 int approximate_op_count_; |
52 | 53 |
53 // The size, in bytes, of the memory owned by this display item but not | 54 // The size, in bytes, of the memory owned by this display item but not |
54 // allocated within it (e.g. held through scoped_ptr or vector). | 55 // allocated within it (e.g. held through scoped_ptr or vector). |
55 size_t external_memory_usage_; | 56 size_t external_memory_usage_; |
56 }; | 57 }; |
57 | 58 |
58 } // namespace cc | 59 } // namespace cc |
59 | 60 |
60 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ | 61 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ |
OLD | NEW |