| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "cc/resources/clip_path_display_item.h" | 5 #include "cc/resources/clip_path_display_item.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/trace_event/trace_event_argument.h" | 8 #include "base/trace_event/trace_event_argument.h" |
| 9 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 int ClipPathDisplayItem::ApproximateOpCount() const { | 32 int ClipPathDisplayItem::ApproximateOpCount() const { |
| 33 return 1; | 33 return 1; |
| 34 } | 34 } |
| 35 | 35 |
| 36 size_t ClipPathDisplayItem::PictureMemoryUsage() const { | 36 size_t ClipPathDisplayItem::PictureMemoryUsage() const { |
| 37 size_t total_size = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool); | 37 size_t total_size = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool); |
| 38 return total_size; | 38 return total_size; |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ClipPathDisplayItem::AsValueInto(base::debug::TracedValue* array) const { | 41 void ClipPathDisplayItem::AsValueInto( |
| 42 base::trace_event::TracedValue* array) const { |
| 42 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d", | 43 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d", |
| 43 clip_path_.countPoints())); | 44 clip_path_.countPoints())); |
| 44 } | 45 } |
| 45 | 46 |
| 46 EndClipPathDisplayItem::EndClipPathDisplayItem() { | 47 EndClipPathDisplayItem::EndClipPathDisplayItem() { |
| 47 } | 48 } |
| 48 | 49 |
| 49 EndClipPathDisplayItem::~EndClipPathDisplayItem() { | 50 EndClipPathDisplayItem::~EndClipPathDisplayItem() { |
| 50 } | 51 } |
| 51 | 52 |
| 52 void EndClipPathDisplayItem::Raster(SkCanvas* canvas, | 53 void EndClipPathDisplayItem::Raster(SkCanvas* canvas, |
| 53 SkDrawPictureCallback* callback) const { | 54 SkDrawPictureCallback* callback) const { |
| 54 canvas->restore(); | 55 canvas->restore(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const { | 58 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const { |
| 58 return true; | 59 return true; |
| 59 } | 60 } |
| 60 | 61 |
| 61 int EndClipPathDisplayItem::ApproximateOpCount() const { | 62 int EndClipPathDisplayItem::ApproximateOpCount() const { |
| 62 return 0; | 63 return 0; |
| 63 } | 64 } |
| 64 | 65 |
| 65 size_t EndClipPathDisplayItem::PictureMemoryUsage() const { | 66 size_t EndClipPathDisplayItem::PictureMemoryUsage() const { |
| 66 return 0; | 67 return 0; |
| 67 } | 68 } |
| 68 | 69 |
| 69 void EndClipPathDisplayItem::AsValueInto( | 70 void EndClipPathDisplayItem::AsValueInto( |
| 70 base::debug::TracedValue* array) const { | 71 base::trace_event::TracedValue* array) const { |
| 71 array->AppendString("EndClipPathDisplayItem"); | 72 array->AppendString("EndClipPathDisplayItem"); |
| 72 } | 73 } |
| 73 | 74 |
| 74 } // namespace cc | 75 } // namespace cc |
| OLD | NEW |