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

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

Issue 1144693002: cc: Move files out of cc/resources/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resources: android 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/transform_display_item.h ('k') | cc/resources/zero_copy_tile_task_worker_pool.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()
14 : transform_(gfx::Transform::kSkipInitialization) {
15 }
16
17 TransformDisplayItem::~TransformDisplayItem() {
18 }
19
20 void TransformDisplayItem::SetNew(const gfx::Transform& transform) {
21 transform_ = transform;
22
23 size_t memory_usage = sizeof(gfx::Transform);
24 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 1 /* op_count */,
25 memory_usage);
26 }
27
28 void TransformDisplayItem::Raster(SkCanvas* canvas,
29 SkDrawPictureCallback* callback) const {
30 canvas->save();
31 if (!transform_.IsIdentity())
32 canvas->concat(transform_.matrix());
33 }
34
35 void TransformDisplayItem::AsValueInto(
36 base::trace_event::TracedValue* array) const {
37 array->AppendString(base::StringPrintf("TransformDisplayItem transform: [%s]",
38 transform_.ToString().c_str()));
39 }
40
41 EndTransformDisplayItem::EndTransformDisplayItem() {
42 DisplayItem::SetNew(true /* suitable_for_gpu_raster */, 0 /* op_count */,
43 0 /* memory_usage */);
44 }
45
46 EndTransformDisplayItem::~EndTransformDisplayItem() {
47 }
48
49 void EndTransformDisplayItem::Raster(SkCanvas* canvas,
50 SkDrawPictureCallback* callback) const {
51 canvas->restore();
52 }
53
54 void EndTransformDisplayItem::AsValueInto(
55 base::trace_event::TracedValue* array) const {
56 array->AppendString("EndTransformDisplayItem");
57 }
58
59 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/transform_display_item.h ('k') | cc/resources/zero_copy_tile_task_worker_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698