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

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

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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/transform_display_item.h ('k') | cc/resources/ui_resource_bitmap.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 "base/strings/stringprintf.h"
8 #include "base/trace_event/trace_event_argument.h"
9 #include "third_party/skia/include/core/SkCanvas.h"
10
11 namespace cc {
12
13 TransformDisplayItem::TransformDisplayItem(const gfx::Transform& transform)
14 : transform_(transform) {
15 }
16
17 TransformDisplayItem::~TransformDisplayItem() {
18 }
19
20 void TransformDisplayItem::Raster(SkCanvas* canvas,
21 SkDrawPictureCallback* callback) const {
22 canvas->save();
23 if (!transform_.IsIdentity())
24 canvas->concat(transform_.matrix());
25 }
26
27 bool TransformDisplayItem::IsSuitableForGpuRasterization() const {
28 return true;
29 }
30
31 int TransformDisplayItem::ApproximateOpCount() const {
32 return 1;
33 }
34
35 size_t TransformDisplayItem::PictureMemoryUsage() const {
36 return sizeof(gfx::Transform);
37 }
38
39 void TransformDisplayItem::AsValueInto(
40 base::trace_event::TracedValue* array) const {
41 array->AppendString(base::StringPrintf("TransformDisplayItem transform: [%s]",
42 transform_.ToString().c_str()));
43 }
44
45 EndTransformDisplayItem::EndTransformDisplayItem() {
46 }
47
48 EndTransformDisplayItem::~EndTransformDisplayItem() {
49 }
50
51 void EndTransformDisplayItem::Raster(SkCanvas* canvas,
52 SkDrawPictureCallback* callback) const {
53 canvas->restore();
54 }
55
56 bool EndTransformDisplayItem::IsSuitableForGpuRasterization() const {
57 return true;
58 }
59
60 int EndTransformDisplayItem::ApproximateOpCount() const {
61 return 0;
62 }
63
64 size_t EndTransformDisplayItem::PictureMemoryUsage() const {
65 return 0;
66 }
67
68 void EndTransformDisplayItem::AsValueInto(
69 base::trace_event::TracedValue* array) const {
70 array->AppendString("EndTransformDisplayItem");
71 }
72
73 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/transform_display_item.h ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698