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

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

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

Powered by Google App Engine
This is Rietveld 408576698