| 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/float_clip_display_item.h" | 5 #include "cc/resources/float_clip_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 "ui/gfx/skia_util.h" | 10 #include "ui/gfx/skia_util.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 FloatClipDisplayItem::FloatClipDisplayItem(gfx::RectF clip_rect) | 14 FloatClipDisplayItem::FloatClipDisplayItem() { |
| 15 : clip_rect_(clip_rect) { | |
| 16 } | 15 } |
| 17 | 16 |
| 18 FloatClipDisplayItem::~FloatClipDisplayItem() { | 17 FloatClipDisplayItem::~FloatClipDisplayItem() { |
| 19 } | 18 } |
| 20 | 19 |
| 20 void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) { |
| 21 clip_rect_ = clip_rect; |
| 22 } |
| 23 |
| 21 void FloatClipDisplayItem::Raster(SkCanvas* canvas, | 24 void FloatClipDisplayItem::Raster(SkCanvas* canvas, |
| 22 SkDrawPictureCallback* callback) const { | 25 SkDrawPictureCallback* callback) const { |
| 23 canvas->save(); | 26 canvas->save(); |
| 24 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); | 27 canvas->clipRect(gfx::RectFToSkRect(clip_rect_)); |
| 25 } | 28 } |
| 26 | 29 |
| 27 bool FloatClipDisplayItem::IsSuitableForGpuRasterization() const { | 30 bool FloatClipDisplayItem::IsSuitableForGpuRasterization() const { |
| 28 return true; | 31 return true; |
| 29 } | 32 } |
| 30 | 33 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 size_t EndFloatClipDisplayItem::PictureMemoryUsage() const { | 67 size_t EndFloatClipDisplayItem::PictureMemoryUsage() const { |
| 65 return 0; | 68 return 0; |
| 66 } | 69 } |
| 67 | 70 |
| 68 void EndFloatClipDisplayItem::AsValueInto( | 71 void EndFloatClipDisplayItem::AsValueInto( |
| 69 base::trace_event::TracedValue* array) const { | 72 base::trace_event::TracedValue* array) const { |
| 70 array->AppendString("EndFloatClipDisplayItem"); | 73 array->AppendString("EndFloatClipDisplayItem"); |
| 71 } | 74 } |
| 72 | 75 |
| 73 } // namespace cc | 76 } // namespace cc |
| OLD | NEW |