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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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/quads/tile_draw_quad.cc ('k') | cc/resources/display_item_list.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_DISPLAY_ITEM_LIST_H_ 5 #ifndef CC_RESOURCES_DISPLAY_ITEM_LIST_H_
6 #define CC_RESOURCES_DISPLAY_ITEM_LIST_H_ 6 #define CC_RESOURCES_DISPLAY_ITEM_LIST_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/base/scoped_ptr_vector.h" 12 #include "cc/base/scoped_ptr_vector.h"
13 #include "cc/resources/display_item.h" 13 #include "cc/resources/display_item.h"
14 #include "skia/ext/refptr.h"
15 #include "third_party/skia/include/core/SkPicture.h"
14 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
15 17
16 class SkCanvas; 18 class SkCanvas;
17 class SkDrawPictureCallback; 19 class SkDrawPictureCallback;
18 20
19 namespace cc { 21 namespace cc {
20 22
21 class CC_EXPORT DisplayItemList 23 class CC_EXPORT DisplayItemList
22 : public base::RefCountedThreadSafe<DisplayItemList> { 24 : public base::RefCountedThreadSafe<DisplayItemList> {
23 public: 25 public:
24 static scoped_refptr<DisplayItemList> Create(); 26 static scoped_refptr<DisplayItemList> Create();
25 27
26 void Raster(SkCanvas* canvas, 28 void Raster(SkCanvas* canvas,
27 SkDrawPictureCallback* callback, 29 SkDrawPictureCallback* callback,
28 float contents_scale) const; 30 float contents_scale) const;
29 31
30 void AppendItem(scoped_ptr<DisplayItem> item); 32 void AppendItem(scoped_ptr<DisplayItem> item);
31 33
32 void set_layer_rect(gfx::Rect layer_rect) { layer_rect_ = layer_rect; } 34 void set_layer_rect(gfx::Rect layer_rect) { layer_rect_ = layer_rect; }
33 gfx::Rect layer_rect() const { return layer_rect_; } 35 gfx::Rect layer_rect() const { return layer_rect_; }
34 36
37 void CreateAndCacheSkPicture();
38
35 bool IsSuitableForGpuRasterization() const; 39 bool IsSuitableForGpuRasterization() const;
36 int ApproximateOpCount() const; 40 int ApproximateOpCount() const;
37 size_t PictureMemoryUsage() const; 41 size_t PictureMemoryUsage() const;
38 42
39 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 43 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
40 44
41 void EmitTraceSnapshot() const; 45 void EmitTraceSnapshot() const;
42 46
43 private: 47 private:
44 DisplayItemList(); 48 DisplayItemList();
45 ~DisplayItemList(); 49 ~DisplayItemList();
46 ScopedPtrVector<DisplayItem> items_; 50 ScopedPtrVector<DisplayItem> items_;
51 skia::RefPtr<SkPicture> picture_;
52
47 gfx::Rect layer_rect_; 53 gfx::Rect layer_rect_;
48 bool is_suitable_for_gpu_rasterization_; 54 bool is_suitable_for_gpu_rasterization_;
49 int approximate_op_count_; 55 int approximate_op_count_;
50 56
51 friend class base::RefCountedThreadSafe<DisplayItemList>; 57 friend class base::RefCountedThreadSafe<DisplayItemList>;
52 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); 58 DISALLOW_COPY_AND_ASSIGN(DisplayItemList);
53 }; 59 };
54 60
55 } // namespace cc 61 } // namespace cc
56 62
57 #endif // CC_RESOURCES_DISPLAY_ITEM_LIST_H_ 63 #endif // CC_RESOURCES_DISPLAY_ITEM_LIST_H_
OLDNEW
« no previous file with comments | « cc/quads/tile_draw_quad.cc ('k') | cc/resources/display_item_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698