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

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

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/largest_display_item.cc ('k') | cc/resources/transform_display_item.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 #ifndef CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_ 5 #ifndef CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_
6 #define CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_ 6 #define CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/resources/display_item.h" 10 #include "cc/resources/display_item.h"
11 #include "ui/gfx/transform.h" 11 #include "ui/gfx/transform.h"
12 12
13 class SkCanvas; 13 class SkCanvas;
14 class SkDrawPictureCallback; 14 class SkDrawPictureCallback;
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class CC_EXPORT TransformDisplayItem : public DisplayItem { 18 class CC_EXPORT TransformDisplayItem : public DisplayItem {
19 public: 19 public:
20 TransformDisplayItem();
20 ~TransformDisplayItem() override; 21 ~TransformDisplayItem() override;
21 22
22 static scoped_ptr<TransformDisplayItem> Create( 23 void SetNew(const gfx::Transform& transform);
23 const gfx::Transform& transform) {
24 return make_scoped_ptr(new TransformDisplayItem(transform));
25 }
26 24
27 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; 25 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override;
28 26
29 bool IsSuitableForGpuRasterization() const override; 27 bool IsSuitableForGpuRasterization() const override;
30 int ApproximateOpCount() const override; 28 int ApproximateOpCount() const override;
31 size_t PictureMemoryUsage() const override; 29 size_t PictureMemoryUsage() const override;
32 void AsValueInto(base::trace_event::TracedValue* array) const override; 30 void AsValueInto(base::trace_event::TracedValue* array) const override;
33 31
34 protected: 32 protected:
35 explicit TransformDisplayItem(const gfx::Transform& transform); 33 explicit TransformDisplayItem(const gfx::Transform& transform);
36 34
37 private: 35 private:
38 gfx::Transform transform_; 36 gfx::Transform transform_;
39 }; 37 };
40 38
41 class CC_EXPORT EndTransformDisplayItem : public DisplayItem { 39 class CC_EXPORT EndTransformDisplayItem : public DisplayItem {
42 public: 40 public:
41 EndTransformDisplayItem();
43 ~EndTransformDisplayItem() override; 42 ~EndTransformDisplayItem() override;
44 43
45 static scoped_ptr<EndTransformDisplayItem> Create() { 44 static scoped_ptr<EndTransformDisplayItem> Create() {
46 return make_scoped_ptr(new EndTransformDisplayItem()); 45 return make_scoped_ptr(new EndTransformDisplayItem());
47 } 46 }
48 47
49 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; 48 void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override;
50 49
51 bool IsSuitableForGpuRasterization() const override; 50 bool IsSuitableForGpuRasterization() const override;
52 int ApproximateOpCount() const override; 51 int ApproximateOpCount() const override;
53 size_t PictureMemoryUsage() const override; 52 size_t PictureMemoryUsage() const override;
54 void AsValueInto(base::trace_event::TracedValue* array) const override; 53 void AsValueInto(base::trace_event::TracedValue* array) const override;
55
56 protected:
57 EndTransformDisplayItem();
58 }; 54 };
59 55
60 } // namespace cc 56 } // namespace cc
61 57
62 #endif // CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_ 58 #endif // CC_RESOURCES_TRANSFORM_DISPLAY_ITEM_H_
OLDNEW
« no previous file with comments | « cc/resources/largest_display_item.cc ('k') | cc/resources/transform_display_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698