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

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

Issue 2751833007: cc: Move DisplayItem::Raster up to DisplayItemList (Closed)
Patch Set: virtualraster: . Created 3 years, 9 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/playback/float_clip_display_item.h ('k') | cc/playback/transform_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/playback/float_clip_display_item.h" 5 #include "cc/playback/float_clip_display_item.h"
6 6
7 #include <stddef.h>
8
9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event_argument.h"
11 #include "third_party/skia/include/core/SkCanvas.h"
12 #include "ui/gfx/skia_util.h"
13
14 namespace cc { 7 namespace cc {
15 8
16 FloatClipDisplayItem::FloatClipDisplayItem(const gfx::RectF& clip_rect) 9 FloatClipDisplayItem::FloatClipDisplayItem(const gfx::RectF& clip_rect)
17 : DisplayItem(FLOAT_CLIP) { 10 : DisplayItem(FLOAT_CLIP), clip_rect(clip_rect) {}
18 SetNew(clip_rect);
19 }
20 11
21 FloatClipDisplayItem::~FloatClipDisplayItem() { 12 FloatClipDisplayItem::~FloatClipDisplayItem() = default;
22 }
23
24 void FloatClipDisplayItem::SetNew(const gfx::RectF& clip_rect) {
25 clip_rect_ = clip_rect;
26 }
27
28 void FloatClipDisplayItem::Raster(SkCanvas* canvas,
29 SkPicture::AbortCallback* callback) const {
30 canvas->save();
31 canvas->clipRect(gfx::RectFToSkRect(clip_rect_));
32 }
33 13
34 EndFloatClipDisplayItem::EndFloatClipDisplayItem() 14 EndFloatClipDisplayItem::EndFloatClipDisplayItem()
35 : DisplayItem(END_FLOAT_CLIP) {} 15 : DisplayItem(END_FLOAT_CLIP) {}
36 16
37 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() { 17 EndFloatClipDisplayItem::~EndFloatClipDisplayItem() = default;
38 }
39
40 void EndFloatClipDisplayItem::Raster(
41 SkCanvas* canvas,
42 SkPicture::AbortCallback* callback) const {
43 canvas->restore();
44 }
45 18
46 } // namespace cc 19 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/float_clip_display_item.h ('k') | cc/playback/transform_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698