Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: cc/resources/float_clip_display_item.cc

Issue 1123983002: cc: Use a ListContainer for DisplayItemList to reduce allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaylistcontainer: fixdcheck Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/float_clip_display_item.h ('k') | cc/resources/largest_display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/resources/float_clip_display_item.h ('k') | cc/resources/largest_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698