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

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

Issue 15774010: Add TRACE_EVENT_IS_NEW_TRACE as a way to snapshot objects at start of recording (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address enne feedback Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_PICTURE_H_ 5 #ifndef CC_RESOURCES_PICTURE_H_
6 #define CC_RESOURCES_PICTURE_H_ 6 #define CC_RESOURCES_PICTURE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool HasRecording() const { return picture_.get() != NULL; } 71 bool HasRecording() const { return picture_.get() != NULL; }
72 72
73 // Apply this contents scale and raster the content rect into the canvas. 73 // Apply this contents scale and raster the content rect into the canvas.
74 void Raster(SkCanvas* canvas, 74 void Raster(SkCanvas* canvas,
75 SkDrawPictureCallback* callback, 75 SkDrawPictureCallback* callback,
76 gfx::Rect content_rect, 76 gfx::Rect content_rect,
77 float contents_scale, 77 float contents_scale,
78 bool enable_lcd_text); 78 bool enable_lcd_text);
79 79
80 scoped_ptr<base::Value> AsValue() const; 80 scoped_ptr<base::Value> AsValue() const;
81 void DidBeginTracing();
81 82
82 class CC_EXPORT PixelRefIterator { 83 class CC_EXPORT PixelRefIterator {
83 public: 84 public:
84 PixelRefIterator(); 85 PixelRefIterator();
85 PixelRefIterator(gfx::Rect layer_rect, const Picture* picture); 86 PixelRefIterator(gfx::Rect layer_rect, const Picture* picture);
86 ~PixelRefIterator(); 87 ~PixelRefIterator();
87 88
88 skia::LazyPixelRef* operator->() const { 89 skia::LazyPixelRef* operator->() const {
89 DCHECK_LT(current_index_, current_pixel_refs_->size()); 90 DCHECK_LT(current_index_, current_pixel_refs_->size());
90 return (*current_pixel_refs_)[current_index_]; 91 return (*current_pixel_refs_)[current_index_];
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 typedef std::vector<scoped_refptr<Picture> > PictureVector; 131 typedef std::vector<scoped_refptr<Picture> > PictureVector;
131 PictureVector clones_; 132 PictureVector clones_;
132 133
133 PixelRefMap pixel_refs_; 134 PixelRefMap pixel_refs_;
134 gfx::Point min_pixel_cell_; 135 gfx::Point min_pixel_cell_;
135 gfx::Point max_pixel_cell_; 136 gfx::Point max_pixel_cell_;
136 gfx::Size cell_size_; 137 gfx::Size cell_size_;
137 138
138 scoped_ptr<base::debug::ConvertableToTraceFormat> 139 scoped_ptr<base::debug::ConvertableToTraceFormat>
139 AsTraceableRasterData(gfx::Rect rect, float scale); 140 AsTraceableRasterData(gfx::Rect rect, float scale);
141 void EmitTraceSnapshot();
140 142
141 friend class base::RefCountedThreadSafe<Picture>; 143 friend class base::RefCountedThreadSafe<Picture>;
142 friend class PixelRefIterator; 144 friend class PixelRefIterator;
143 DISALLOW_COPY_AND_ASSIGN(Picture); 145 DISALLOW_COPY_AND_ASSIGN(Picture);
144 }; 146 };
145 147
146 } // namespace cc 148 } // namespace cc
147 149
148 #endif // CC_RESOURCES_PICTURE_H_ 150 #endif // CC_RESOURCES_PICTURE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698