| 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" |
| 8 #include "base/trace_event/trace_event_argument.h" |
| 7 #include "third_party/skia/include/core/SkCanvas.h" | 9 #include "third_party/skia/include/core/SkCanvas.h" |
| 8 | 10 |
| 9 namespace cc { | 11 namespace cc { |
| 10 | 12 |
| 11 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path, | 13 ClipPathDisplayItem::ClipPathDisplayItem(const SkPath& clip_path, |
| 12 SkRegion::Op clip_op, | 14 SkRegion::Op clip_op, |
| 13 bool antialias) | 15 bool antialias) |
| 14 : clip_path_(clip_path), clip_op_(clip_op), antialias_(antialias) { | 16 : clip_path_(clip_path), clip_op_(clip_op), antialias_(antialias) { |
| 15 } | 17 } |
| 16 | 18 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 29 | 31 |
| 30 int ClipPathDisplayItem::ApproximateOpCount() const { | 32 int ClipPathDisplayItem::ApproximateOpCount() const { |
| 31 return 1; | 33 return 1; |
| 32 } | 34 } |
| 33 | 35 |
| 34 size_t ClipPathDisplayItem::PictureMemoryUsage() const { | 36 size_t ClipPathDisplayItem::PictureMemoryUsage() const { |
| 35 size_t total_size = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool); | 37 size_t total_size = sizeof(SkPath) + sizeof(SkRegion::Op) + sizeof(bool); |
| 36 return total_size; | 38 return total_size; |
| 37 } | 39 } |
| 38 | 40 |
| 41 void ClipPathDisplayItem::AsValueInto(base::debug::TracedValue* array) const { |
| 42 array->AppendString(base::StringPrintf("ClipPathDisplayItem length: %d", |
| 43 clip_path_.countPoints())); |
| 44 } |
| 45 |
| 39 EndClipPathDisplayItem::EndClipPathDisplayItem() { | 46 EndClipPathDisplayItem::EndClipPathDisplayItem() { |
| 40 } | 47 } |
| 41 | 48 |
| 42 EndClipPathDisplayItem::~EndClipPathDisplayItem() { | 49 EndClipPathDisplayItem::~EndClipPathDisplayItem() { |
| 43 } | 50 } |
| 44 | 51 |
| 45 void EndClipPathDisplayItem::Raster(SkCanvas* canvas, | 52 void EndClipPathDisplayItem::Raster(SkCanvas* canvas, |
| 46 SkDrawPictureCallback* callback) const { | 53 SkDrawPictureCallback* callback) const { |
| 47 canvas->restore(); | 54 canvas->restore(); |
| 48 } | 55 } |
| 49 | 56 |
| 50 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const { | 57 bool EndClipPathDisplayItem::IsSuitableForGpuRasterization() const { |
| 51 return true; | 58 return true; |
| 52 } | 59 } |
| 53 | 60 |
| 54 int EndClipPathDisplayItem::ApproximateOpCount() const { | 61 int EndClipPathDisplayItem::ApproximateOpCount() const { |
| 55 return 0; | 62 return 0; |
| 56 } | 63 } |
| 57 | 64 |
| 58 size_t EndClipPathDisplayItem::PictureMemoryUsage() const { | 65 size_t EndClipPathDisplayItem::PictureMemoryUsage() const { |
| 59 return 0; | 66 return 0; |
| 60 } | 67 } |
| 61 | 68 |
| 69 void EndClipPathDisplayItem::AsValueInto( |
| 70 base::debug::TracedValue* array) const { |
| 71 array->AppendString("EndClipPathDisplayItem"); |
| 72 } |
| 73 |
| 62 } // namespace cc | 74 } // namespace cc |
| OLD | NEW |