| 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 11 matching lines...) Expand all Loading... |
| 22 void SetNew(bool is_suitable_for_gpu_rasterization, | 22 void SetNew(bool is_suitable_for_gpu_rasterization, |
| 23 int approximate_op_count, | 23 int approximate_op_count, |
| 24 size_t picture_memory_usage) { | 24 size_t picture_memory_usage) { |
| 25 is_suitable_for_gpu_rasterization_ = is_suitable_for_gpu_rasterization; | 25 is_suitable_for_gpu_rasterization_ = is_suitable_for_gpu_rasterization; |
| 26 approximate_op_count_ = approximate_op_count; | 26 approximate_op_count_ = approximate_op_count; |
| 27 picture_memory_usage_ = | 27 picture_memory_usage_ = |
| 28 picture_memory_usage + sizeof(bool) + sizeof(int) + sizeof(size_t); | 28 picture_memory_usage + sizeof(bool) + sizeof(int) + sizeof(size_t); |
| 29 } | 29 } |
| 30 | 30 |
| 31 virtual void Raster(SkCanvas* canvas, | 31 virtual void Raster(SkCanvas* canvas, |
| 32 const gfx::Rect& canvas_target_playback_rect, |
| 32 SkPicture::AbortCallback* callback) const = 0; | 33 SkPicture::AbortCallback* callback) const = 0; |
| 33 virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0; | 34 virtual void AsValueInto(base::trace_event::TracedValue* array) const = 0; |
| 34 | 35 |
| 35 bool is_suitable_for_gpu_rasterization() const { | 36 bool is_suitable_for_gpu_rasterization() const { |
| 36 return is_suitable_for_gpu_rasterization_; | 37 return is_suitable_for_gpu_rasterization_; |
| 37 } | 38 } |
| 38 int approximate_op_count() const { return approximate_op_count_; } | 39 int approximate_op_count() const { return approximate_op_count_; } |
| 39 size_t picture_memory_usage() const { return picture_memory_usage_; } | 40 size_t picture_memory_usage() const { return picture_memory_usage_; } |
| 40 | 41 |
| 41 protected: | 42 protected: |
| 42 DisplayItem(); | 43 DisplayItem(); |
| 43 | 44 |
| 44 bool is_suitable_for_gpu_rasterization_; | 45 bool is_suitable_for_gpu_rasterization_; |
| 45 int approximate_op_count_; | 46 int approximate_op_count_; |
| 46 size_t picture_memory_usage_; | 47 size_t picture_memory_usage_; |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace cc | 50 } // namespace cc |
| 50 | 51 |
| 51 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ | 52 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ |
| OLD | NEW |