OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPicture_DEFINED | 10 #ifndef SkPicture_DEFINED |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 // Create a new SkPicture from an existing SkPictureData. The new picture | 266 // Create a new SkPicture from an existing SkPictureData. The new picture |
267 // takes ownership of 'data'. | 267 // takes ownership of 'data'. |
268 SkPicture(SkPictureData* data, SkScalar width, SkScalar height); | 268 SkPicture(SkPictureData* data, SkScalar width, SkScalar height); |
269 | 269 |
270 SkPicture(SkScalar width, SkScalar height, const SkPictureRecord& record, bo
ol deepCopyOps); | 270 SkPicture(SkScalar width, SkScalar height, const SkPictureRecord& record, bo
ol deepCopyOps); |
271 | 271 |
272 void createHeader(SkPictInfo* info) const; | 272 void createHeader(SkPictInfo* info) const; |
273 static bool IsValidPictInfo(const SkPictInfo& info); | 273 static bool IsValidPictInfo(const SkPictInfo& info); |
274 | 274 |
275 friend class SkPictureRecorder; // just for SkPicture-based const
ructor | 275 friend class SkPictureRecorder; // SkRecord-based constructor. |
276 friend class SkGpuDevice; // for fData access | 276 friend class SkGpuDevice; // for fData access |
277 friend class GrLayerHoister; // access to fRecord | 277 friend class GrLayerHoister; // access to fRecord |
278 friend class CollectLayers; // access to fRecord | 278 friend class CollectLayers; // access to fRecord |
279 friend class SkPicturePlayback; // to get fData | 279 friend class SkPicturePlayback; // to get fData |
280 friend void GrRecordReplaceDraw(const SkPicture* picture, | 280 friend void GrRecordReplaceDraw(const SkPicture* picture, |
281 SkCanvas* canvas, | 281 SkCanvas* canvas, |
282 const GrReplacements* replacements, | 282 const GrReplacements* replacements, |
283 const SkMatrix& initialMatrix, | 283 const SkMatrix& initialMatrix, |
284 SkDrawPictureCallback* callback); | 284 SkDrawPictureCallback* callback); |
285 | 285 |
286 typedef SkRefCnt INHERITED; | 286 typedef SkRefCnt INHERITED; |
287 | 287 |
288 // Takes ownership of the SkRecord, refs the (optional) BBH. | 288 // Takes ownership of the SkRecord, refs the (optional) BBH. |
289 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); | 289 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); |
290 // Return as a new SkPicture that's backed by SkRecord. | 290 // Return as a new SkPicture that's backed by SkRecord. |
291 static SkPicture* Forwardport(const SkPicture&); | 291 static SkPicture* Forwardport(const SkPicture&); |
| 292 // Return as a new SkPicture that's backed by the old backend. |
| 293 static SkPicture* Backport(const SkRecord& src, const SkRect& cullRect); |
292 | 294 |
293 SkAutoTDelete<SkRecord> fRecord; | 295 SkAutoTDelete<SkRecord> fRecord; |
294 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 296 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
295 | 297 |
296 struct PathCounter; | 298 struct PathCounter; |
297 | 299 |
298 struct Analysis { | 300 struct Analysis { |
299 Analysis() {} // Only used by SkPictureData codepath. | 301 Analysis() {} // Only used by SkPictureData codepath. |
300 explicit Analysis(const SkRecord&); | 302 explicit Analysis(const SkRecord&); |
301 | 303 |
302 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; | 304 bool suitableForGpuRasterization(const char** reason, int sampleCount) c
onst; |
303 | 305 |
304 bool fWillPlaybackBitmaps; | 306 bool fWillPlaybackBitmaps; |
305 bool fHasText; | 307 bool fHasText; |
306 int fNumPaintWithPathEffectUses; | 308 int fNumPaintWithPathEffectUses; |
307 int fNumFastPathDashEffects; | 309 int fNumFastPathDashEffects; |
308 int fNumAAConcavePaths; | 310 int fNumAAConcavePaths; |
309 int fNumAAHairlineConcavePaths; | 311 int fNumAAHairlineConcavePaths; |
310 } fAnalysis; | 312 } fAnalysis; |
311 }; | 313 }; |
312 | 314 |
313 #endif | 315 #endif |
OLD | NEW |