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

Side by Side Diff: cc/playback/transform_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/transform_display_item.h ('k') | ui/compositor/paint_cache.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 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/playback/transform_display_item.h" 5 #include "cc/playback/transform_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
13 namespace cc { 7 namespace cc {
14 8
15 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform) 9 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform)
16 : DisplayItem(TRANSFORM), transform_(gfx::Transform::kSkipInitialization) { 10 : DisplayItem(TRANSFORM), transform(transform) {}
17 SetNew(transform);
18 }
19 11
20 TransformDisplayItem::~TransformDisplayItem() { 12 TransformDisplayItem::~TransformDisplayItem() = default;
21 }
22
23 void TransformDisplayItem::SetNew(const gfx::Transform& transform) {
24 transform_ = transform;
25 }
26
27 void TransformDisplayItem::Raster(SkCanvas* canvas,
28 SkPicture::AbortCallback* callback) const {
29 canvas->save();
30 if (!transform_.IsIdentity())
31 canvas->concat(transform_.matrix());
32 }
33 13
34 EndTransformDisplayItem::EndTransformDisplayItem() 14 EndTransformDisplayItem::EndTransformDisplayItem()
35 : DisplayItem(END_TRANSFORM) {} 15 : DisplayItem(END_TRANSFORM) {}
36 16
37 EndTransformDisplayItem::~EndTransformDisplayItem() { 17 EndTransformDisplayItem::~EndTransformDisplayItem() = default;
38 }
39
40 void EndTransformDisplayItem::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/transform_display_item.h ('k') | ui/compositor/paint_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698