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