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

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

Issue 18078003: Use factory for creating SkPicture from a stream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 5 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
« no previous file with comments | « no previous file | cc/resources/picture.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 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 gfx::Point min_point_; 111 gfx::Point min_point_;
112 gfx::Point max_point_; 112 gfx::Point max_point_;
113 int current_x_; 113 int current_x_;
114 int current_y_; 114 int current_y_;
115 }; 115 };
116 116
117 void EmitTraceSnapshot(); 117 void EmitTraceSnapshot();
118 118
119 private: 119 private:
120 explicit Picture(gfx::Rect layer_rect); 120 explicit Picture(gfx::Rect layer_rect);
121 Picture(const base::Value*, bool* success);
122 // This constructor assumes SkPicture is already ref'd and transfers 121 // This constructor assumes SkPicture is already ref'd and transfers
123 // ownership to this picture. 122 // ownership to this picture.
124 Picture(const skia::RefPtr<SkPicture>&, 123 Picture(const skia::RefPtr<SkPicture>&,
125 gfx::Rect layer_rect, 124 gfx::Rect layer_rect,
126 gfx::Rect opaque_rect, 125 gfx::Rect opaque_rect,
127 const PixelRefMap& pixel_refs); 126 const PixelRefMap& pixel_refs);
127 // This constructor will call AdoptRef on the SkPicture.
128 Picture(SkPicture*,
129 gfx::Rect layer_rect,
130 gfx::Rect opaque_rect);
128 ~Picture(); 131 ~Picture();
129 132
130 gfx::Rect layer_rect_; 133 gfx::Rect layer_rect_;
131 gfx::Rect opaque_rect_; 134 gfx::Rect opaque_rect_;
132 skia::RefPtr<SkPicture> picture_; 135 skia::RefPtr<SkPicture> picture_;
133 136
134 typedef std::vector<scoped_refptr<Picture> > PictureVector; 137 typedef std::vector<scoped_refptr<Picture> > PictureVector;
135 PictureVector clones_; 138 PictureVector clones_;
136 139
137 PixelRefMap pixel_refs_; 140 PixelRefMap pixel_refs_;
138 gfx::Point min_pixel_cell_; 141 gfx::Point min_pixel_cell_;
139 gfx::Point max_pixel_cell_; 142 gfx::Point max_pixel_cell_;
140 gfx::Size cell_size_; 143 gfx::Size cell_size_;
141 144
142 scoped_ptr<base::debug::ConvertableToTraceFormat> 145 scoped_ptr<base::debug::ConvertableToTraceFormat>
143 AsTraceableRasterData(gfx::Rect rect, float scale); 146 AsTraceableRasterData(gfx::Rect rect, float scale);
144 147
145 friend class base::RefCountedThreadSafe<Picture>; 148 friend class base::RefCountedThreadSafe<Picture>;
146 friend class PixelRefIterator; 149 friend class PixelRefIterator;
147 DISALLOW_COPY_AND_ASSIGN(Picture); 150 DISALLOW_COPY_AND_ASSIGN(Picture);
148 }; 151 };
149 152
150 } // namespace cc 153 } // namespace cc
151 154
152 #endif // CC_RESOURCES_PICTURE_H_ 155 #endif // CC_RESOURCES_PICTURE_H_
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698