| 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 #include "cc/resources/filter_display_item.h" | 5 #include "cc/resources/filter_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 #include "third_party/skia/include/core/SkImageFilter.h" | 10 #include "third_party/skia/include/core/SkImageFilter.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 int FilterDisplayItem::ApproximateOpCount() const { | 45 int FilterDisplayItem::ApproximateOpCount() const { |
| 46 return 1; | 46 return 1; |
| 47 } | 47 } |
| 48 | 48 |
| 49 size_t FilterDisplayItem::PictureMemoryUsage() const { | 49 size_t FilterDisplayItem::PictureMemoryUsage() const { |
| 50 return sizeof(skia::RefPtr<SkImageFilter>) + sizeof(gfx::RectF); | 50 return sizeof(skia::RefPtr<SkImageFilter>) + sizeof(gfx::RectF); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void FilterDisplayItem::AsValueInto(base::debug::TracedValue* array) const { | 53 void FilterDisplayItem::AsValueInto( |
| 54 base::trace_event::TracedValue* array) const { |
| 54 array->AppendString(base::StringPrintf("FilterDisplayItem bounds: [%s]", | 55 array->AppendString(base::StringPrintf("FilterDisplayItem bounds: [%s]", |
| 55 bounds_.ToString().c_str())); | 56 bounds_.ToString().c_str())); |
| 56 } | 57 } |
| 57 | 58 |
| 58 EndFilterDisplayItem::EndFilterDisplayItem() { | 59 EndFilterDisplayItem::EndFilterDisplayItem() { |
| 59 } | 60 } |
| 60 | 61 |
| 61 EndFilterDisplayItem::~EndFilterDisplayItem() { | 62 EndFilterDisplayItem::~EndFilterDisplayItem() { |
| 62 } | 63 } |
| 63 | 64 |
| 64 void EndFilterDisplayItem::Raster(SkCanvas* canvas, | 65 void EndFilterDisplayItem::Raster(SkCanvas* canvas, |
| 65 SkDrawPictureCallback* callback) const { | 66 SkDrawPictureCallback* callback) const { |
| 66 canvas->restore(); | 67 canvas->restore(); |
| 67 canvas->restore(); | 68 canvas->restore(); |
| 68 } | 69 } |
| 69 | 70 |
| 70 bool EndFilterDisplayItem::IsSuitableForGpuRasterization() const { | 71 bool EndFilterDisplayItem::IsSuitableForGpuRasterization() const { |
| 71 return true; | 72 return true; |
| 72 } | 73 } |
| 73 | 74 |
| 74 int EndFilterDisplayItem::ApproximateOpCount() const { | 75 int EndFilterDisplayItem::ApproximateOpCount() const { |
| 75 return 0; | 76 return 0; |
| 76 } | 77 } |
| 77 | 78 |
| 78 size_t EndFilterDisplayItem::PictureMemoryUsage() const { | 79 size_t EndFilterDisplayItem::PictureMemoryUsage() const { |
| 79 return 0; | 80 return 0; |
| 80 } | 81 } |
| 81 | 82 |
| 82 void EndFilterDisplayItem::AsValueInto(base::debug::TracedValue* array) const { | 83 void EndFilterDisplayItem::AsValueInto( |
| 84 base::trace_event::TracedValue* array) const { |
| 83 array->AppendString("EndFilterDisplayItem"); | 85 array->AppendString("EndFilterDisplayItem"); |
| 84 } | 86 } |
| 85 | 87 |
| 86 } // namespace cc | 88 } // namespace cc |
| OLD | NEW |