| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2011 Google Inc. | 2  * Copyright 2011 Google Inc. | 
| 3  * | 3  * | 
| 4  * Use of this source code is governed by a BSD-style license that can be | 4  * Use of this source code is governed by a BSD-style license that can be | 
| 5  * found in the LICENSE file. | 5  * found in the LICENSE file. | 
| 6  */ | 6  */ | 
| 7 | 7 | 
| 8 #ifndef SkPictureRecord_DEFINED | 8 #ifndef SkPictureRecord_DEFINED | 
| 9 #define SkPictureRecord_DEFINED | 9 #define SkPictureRecord_DEFINED | 
| 10 | 10 | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 146 | 146 | 
| 147 protected: | 147 protected: | 
| 148     void validate(size_t initialOffset, size_t size) const { | 148     void validate(size_t initialOffset, size_t size) const { | 
| 149         SkASSERT(fWriter.bytesWritten() == initialOffset + size); | 149         SkASSERT(fWriter.bytesWritten() == initialOffset + size); | 
| 150     } | 150     } | 
| 151 | 151 | 
| 152     SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override; | 152     SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) override; | 
| 153     bool onPeekPixels(SkPixmap*) override { return false; } | 153     bool onPeekPixels(SkPixmap*) override { return false; } | 
| 154 | 154 | 
| 155     void willSave() override; | 155     void willSave() override; | 
| 156     SaveLayerStrategy willSaveLayer(const SkRect*, const SkPaint*, SaveFlags) ov
     erride; | 156     SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override; | 
| 157     void willRestore() override; | 157     void willRestore() override; | 
| 158 | 158 | 
| 159     void didConcat(const SkMatrix&) override; | 159     void didConcat(const SkMatrix&) override; | 
| 160     void didSetMatrix(const SkMatrix&) override; | 160     void didSetMatrix(const SkMatrix&) override; | 
| 161 | 161 | 
| 162     void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; | 162     void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override; | 
| 163 | 163 | 
| 164     void onDrawText(const void* text, size_t, SkScalar x, SkScalar y, const SkPa
     int&) override; | 164     void onDrawText(const void* text, size_t, SkScalar x, SkScalar y, const SkPa
     int&) override; | 
| 165     void onDrawPosText(const void* text, size_t, const SkPoint pos[], const SkPa
     int&) override; | 165     void onDrawPosText(const void* text, size_t, const SkPoint pos[], const SkPa
     int&) override; | 
| 166     void onDrawPosTextH(const void* text, size_t, const SkScalar xpos[], SkScala
     r constY, | 166     void onDrawPosTextH(const void* text, size_t, const SkScalar xpos[], SkScala
     r constY, | 
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 211     // restores to be deferred (e.g., if the MC state is being collapsed and | 211     // restores to be deferred (e.g., if the MC state is being collapsed and | 
| 212     // only written out as needed). | 212     // only written out as needed). | 
| 213     void recordConcat(const SkMatrix& matrix); | 213     void recordConcat(const SkMatrix& matrix); | 
| 214     void recordTranslate(const SkMatrix& matrix); | 214     void recordTranslate(const SkMatrix& matrix); | 
| 215     void recordScale(const SkMatrix& matrix); | 215     void recordScale(const SkMatrix& matrix); | 
| 216     size_t recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA); | 216     size_t recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA); | 
| 217     size_t recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA); | 217     size_t recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA); | 
| 218     size_t recordClipPath(int pathID, SkRegion::Op op, bool doAA); | 218     size_t recordClipPath(int pathID, SkRegion::Op op, bool doAA); | 
| 219     size_t recordClipRegion(const SkRegion& region, SkRegion::Op op); | 219     size_t recordClipRegion(const SkRegion& region, SkRegion::Op op); | 
| 220     void recordSave(); | 220     void recordSave(); | 
| 221     void recordSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags f
     lags); | 221     void recordSaveLayer(const SaveLayerRec&); | 
| 222     void recordRestore(bool fillInSkips = true); | 222     void recordRestore(bool fillInSkips = true); | 
| 223 | 223 | 
| 224 private: | 224 private: | 
| 225     SkPictureContentInfo fContentInfo; | 225     SkPictureContentInfo fContentInfo; | 
| 226 | 226 | 
| 227     SkTArray<SkBitmap> fBitmaps; | 227     SkTArray<SkBitmap> fBitmaps; | 
| 228     SkTArray<SkPaint>  fPaints; | 228     SkTArray<SkPaint>  fPaints; | 
| 229 | 229 | 
| 230     struct PathHash { | 230     struct PathHash { | 
| 231         uint32_t operator()(const SkPath& p) { return p.getGenerationID(); } | 231         uint32_t operator()(const SkPath& p) { return p.getGenerationID(); } | 
| 232     }; | 232     }; | 
| 233     SkTHashMap<SkPath, int, PathHash> fPaths; | 233     SkTHashMap<SkPath, int, PathHash> fPaths; | 
| 234 | 234 | 
| 235     SkWriter32 fWriter; | 235     SkWriter32 fWriter; | 
| 236 | 236 | 
| 237     // we ref each item in these arrays | 237     // we ref each item in these arrays | 
| 238     SkTDArray<const SkImage*>    fImageRefs; | 238     SkTDArray<const SkImage*>    fImageRefs; | 
| 239     SkTDArray<const SkPicture*>  fPictureRefs; | 239     SkTDArray<const SkPicture*>  fPictureRefs; | 
| 240     SkTDArray<const SkTextBlob*> fTextBlobRefs; | 240     SkTDArray<const SkTextBlob*> fTextBlobRefs; | 
| 241 | 241 | 
| 242     uint32_t fRecordFlags; | 242     uint32_t fRecordFlags; | 
| 243     int      fInitialSaveCount; | 243     int      fInitialSaveCount; | 
| 244 | 244 | 
| 245     friend class SkPictureData;   // for SkPictureData's SkPictureRecord-based c
     onstructor | 245     friend class SkPictureData;   // for SkPictureData's SkPictureRecord-based c
     onstructor | 
| 246 | 246 | 
| 247     typedef SkCanvas INHERITED; | 247     typedef SkCanvas INHERITED; | 
| 248 }; | 248 }; | 
| 249 | 249 | 
| 250 #endif | 250 #endif | 
| OLD | NEW | 
|---|