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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 // Only SKPs within the min/current picture version range (inclusive) can be read. | 252 // Only SKPs within the min/current picture version range (inclusive) can be read. |
253 static const uint32_t MIN_PICTURE_VERSION = 19; | 253 static const uint32_t MIN_PICTURE_VERSION = 19; |
254 static const uint32_t CURRENT_PICTURE_VERSION = 37; | 254 static const uint32_t CURRENT_PICTURE_VERSION = 37; |
255 | 255 |
256 void needsNewGenID() { fUniqueID = SK_InvalidGenID; } | 256 void needsNewGenID() { fUniqueID = SK_InvalidGenID; } |
257 void callDeletionListeners(); | 257 void callDeletionListeners(); |
258 | 258 |
259 void createHeader(SkPictInfo* info) const; | 259 void createHeader(SkPictInfo* info) const; |
260 static bool IsValidPictInfo(const SkPictInfo& info); | 260 static bool IsValidPictInfo(const SkPictInfo& info); |
261 | 261 |
262 // Takes ownership of the SkRecord, refs the (optional) BBH. | 262 // Takes ownership of the SkRecord, refs the (optional) drawablePicts and BB H. |
263 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkBBoxHierarchy*); | 263 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkData* drawablePicts, |
264 SkBBoxHierarchy*); | |
264 | 265 |
265 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 266 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
266 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&); | 267 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, |
268 SkPicture* const drawablePics[], int drawable Count); | |
267 | 269 |
268 const SkScalar fCullWidth; | 270 const SkScalar fCullWidth; |
269 const SkScalar fCullHeight; | 271 const SkScalar fCullHeight; |
270 mutable SkAutoTUnref<const AccelData> fAccelData; | 272 mutable SkAutoTUnref<const AccelData> fAccelData; |
271 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re fed | 273 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re fed |
272 SkAutoTDelete<SkRecord> fRecord; | 274 SkAutoTDelete<SkRecord> fRecord; |
273 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 275 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
276 SkAutoTUnref<SkData> fDrawablePicts; | |
mtklein
2014/11/17 20:40:33
Let's start with SkTDArray<const SkPicture*>, pass
reed1
2014/11/17 21:27:44
as we discussed, pass by value is complicated, sin
| |
277 | |
278 // helpers for fDrawablePicts | |
279 int drawableCount() const; | |
280 // will return NULL if drawableCount() returns 0 | |
281 SkPicture* const* drawablePicts() const; | |
282 | |
283 struct PathCounter; | |
284 | |
274 struct Analysis { | 285 struct Analysis { |
275 Analysis() {} // Only used by SkPictureData codepath. | 286 Analysis() {} // Only used by SkPictureData codepath. |
276 explicit Analysis(const SkRecord&); | 287 explicit Analysis(const SkRecord&); |
277 | 288 |
278 bool suitableForGpuRasterization(const char** reason, int sampleCount) c onst; | 289 bool suitableForGpuRasterization(const char** reason, int sampleCount) c onst; |
279 | 290 |
280 bool fWillPlaybackBitmaps; | 291 bool fWillPlaybackBitmaps; |
281 bool fHasText; | 292 bool fHasText; |
282 int fNumPaintWithPathEffectUses; | 293 int fNumPaintWithPathEffectUses; |
283 int fNumFastPathDashEffects; | 294 int fNumFastPathDashEffects; |
284 int fNumAAConcavePaths; | 295 int fNumAAConcavePaths; |
285 int fNumAAHairlineConcavePaths; | 296 int fNumAAHairlineConcavePaths; |
286 int fNumAADFEligibleConcavePaths; | 297 int fNumAADFEligibleConcavePaths; |
287 } fAnalysis; | 298 } fAnalysis; |
288 mutable uint32_t fUniqueID; | 299 mutable uint32_t fUniqueID; |
289 | 300 |
290 struct PathCounter; | 301 struct PathCounter; |
291 | 302 |
292 friend class SkPictureRecorder; // SkRecord-based constructor. | 303 friend class SkPictureRecorder; // SkRecord-based constructor. |
293 friend class GrLayerHoister; // access to fRecord | 304 friend class GrLayerHoister; // access to fRecord |
294 friend class ReplaceDraw; | 305 friend class ReplaceDraw; |
295 | 306 |
296 typedef SkRefCnt INHERITED; | 307 typedef SkRefCnt INHERITED; |
297 }; | 308 }; |
298 | 309 |
299 #endif | 310 #endif |
OLD | NEW |