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

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

Issue 1123983002: cc: Use a ListContainer for DisplayItemList to reduce allocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaylistcontainer: fixdcheck 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/test/fake_content_layer_client.cc » ('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/resources/transform_display_item.h" 5 #include "cc/resources/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(const gfx::Transform& transform) 13 TransformDisplayItem::TransformDisplayItem()
14 : transform_(transform) { 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) {
21 transform_ = transform;
22 }
23
20 void TransformDisplayItem::Raster(SkCanvas* canvas, 24 void TransformDisplayItem::Raster(SkCanvas* canvas,
21 SkDrawPictureCallback* callback) const { 25 SkDrawPictureCallback* callback) const {
22 canvas->save(); 26 canvas->save();
23 if (!transform_.IsIdentity()) 27 if (!transform_.IsIdentity())
24 canvas->concat(transform_.matrix()); 28 canvas->concat(transform_.matrix());
25 } 29 }
26 30
27 bool TransformDisplayItem::IsSuitableForGpuRasterization() const { 31 bool TransformDisplayItem::IsSuitableForGpuRasterization() const {
28 return true; 32 return true;
29 } 33 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 size_t EndTransformDisplayItem::PictureMemoryUsage() const { 68 size_t EndTransformDisplayItem::PictureMemoryUsage() const {
65 return 0; 69 return 0;
66 } 70 }
67 71
68 void EndTransformDisplayItem::AsValueInto( 72 void EndTransformDisplayItem::AsValueInto(
69 base::trace_event::TracedValue* array) const { 73 base::trace_event::TracedValue* array) const {
70 array->AppendString("EndTransformDisplayItem"); 74 array->AppendString("EndTransformDisplayItem");
71 } 75 }
72 76
73 } // namespace cc 77 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/transform_display_item.h ('k') | cc/test/fake_content_layer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698