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

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

Issue 1045953002: Implement DisplayList GatherPixelRefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash w/ unittest Created 5 years, 8 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/output/renderer_pixeltest.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 "cc/resources/pixel_ref_map.h"
14 #include "skia/ext/refptr.h" 15 #include "skia/ext/refptr.h"
15 #include "third_party/skia/include/core/SkPicture.h" 16 #include "third_party/skia/include/core/SkPicture.h"
16 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
17 18
18 class SkCanvas; 19 class SkCanvas;
19 class SkDrawPictureCallback; 20 class SkDrawPictureCallback;
20 21
21 namespace cc { 22 namespace cc {
22 23
23 class CC_EXPORT DisplayItemList 24 class CC_EXPORT DisplayItemList
(...skipping 13 matching lines...) Expand all
37 void CreateAndCacheSkPicture(); 38 void CreateAndCacheSkPicture();
38 39
39 bool IsSuitableForGpuRasterization() const; 40 bool IsSuitableForGpuRasterization() const;
40 int ApproximateOpCount() const; 41 int ApproximateOpCount() const;
41 size_t PictureMemoryUsage() const; 42 size_t PictureMemoryUsage() const;
42 43
43 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 44 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
44 45
45 void EmitTraceSnapshot() const; 46 void EmitTraceSnapshot() const;
46 47
48 void GatherPixelRefs(const gfx::Size& grid_cell_size);
49
47 private: 50 private:
48 DisplayItemList(); 51 DisplayItemList();
49 ~DisplayItemList(); 52 ~DisplayItemList();
50 ScopedPtrVector<DisplayItem> items_; 53 ScopedPtrVector<DisplayItem> items_;
51 skia::RefPtr<SkPicture> picture_; 54 skia::RefPtr<SkPicture> picture_;
52 55
53 gfx::Rect layer_rect_; 56 gfx::Rect layer_rect_;
54 bool is_suitable_for_gpu_rasterization_; 57 bool is_suitable_for_gpu_rasterization_;
55 int approximate_op_count_; 58 int approximate_op_count_;
56 59
60 scoped_ptr<PixelRefMap> pixel_refs_;
61
57 friend class base::RefCountedThreadSafe<DisplayItemList>; 62 friend class base::RefCountedThreadSafe<DisplayItemList>;
63 friend class PixelRefMap::Iterator;
58 DISALLOW_COPY_AND_ASSIGN(DisplayItemList); 64 DISALLOW_COPY_AND_ASSIGN(DisplayItemList);
59 }; 65 };
60 66
61 } // namespace cc 67 } // namespace cc
62 68
63 #endif // CC_RESOURCES_DISPLAY_ITEM_LIST_H_ 69 #endif // CC_RESOURCES_DISPLAY_ITEM_LIST_H_
OLDNEW
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/resources/display_item_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698