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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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/transform_display_item.h ('k') | cc/resources/transparency_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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/resources/transform_display_item.h"
6
7 #include "third_party/skia/include/core/SkCanvas.h"
8
9 namespace cc {
10
11 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform)
12 : transform_(transform) {
13 }
14
15 TransformDisplayItem::~TransformDisplayItem() {
16 }
17
18 void TransformDisplayItem::Raster(SkCanvas* canvas,
19 SkDrawPictureCallback* callback) const {
20 canvas->save();
21 if (!transform_.IsIdentity())
22 canvas->concat(transform_.matrix());
23 }
24
25 bool TransformDisplayItem::IsSuitableForGpuRasterization() const {
26 return true;
27 }
28
29 int TransformDisplayItem::ApproximateOpCount() const {
30 return 1;
31 }
32
33 size_t TransformDisplayItem::PictureMemoryUsage() const {
34 return sizeof(gfx::Transform);
35 }
36
37 EndTransformDisplayItem::EndTransformDisplayItem() {
38 }
39
40 EndTransformDisplayItem::~EndTransformDisplayItem() {
41 }
42
43 void EndTransformDisplayItem::Raster(SkCanvas* canvas,
44 SkDrawPictureCallback* callback) const {
45 canvas->restore();
46 }
47
48 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const {
49 return true;
50 }
51
52 int EndTransformDisplayItem::ApproximateOpCount() const {
53 return 0;
54 }
55
56 size_t EndTransformDisplayItem::PictureMemoryUsage() const {
57 return 0;
58 }
59
60 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/transform_display_item.h ('k') | cc/resources/transparency_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698