| 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 11 matching lines...) Expand all Loading... |
| 22 small = (combined >> 24) & 0xFF; \ | 22 small = (combined >> 24) & 0xFF; \ |
| 23 large = combined & MASK_24; | 23 large = combined & MASK_24; |
| 24 #define PACK_8_24(small, large) ((small << 24) | large) | 24 #define PACK_8_24(small, large) ((small << 24) | large) |
| 25 | 25 |
| 26 | 26 |
| 27 class SkPictureRecord : public SkCanvas { | 27 class SkPictureRecord : public SkCanvas { |
| 28 public: | 28 public: |
| 29 SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags); | 29 SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags); |
| 30 virtual ~SkPictureRecord(); | 30 virtual ~SkPictureRecord(); |
| 31 | 31 |
| 32 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; | |
| 33 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], | |
| 34 const SkPaint&) SK_OVERRIDE; | |
| 35 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; | |
| 36 virtual void drawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; | |
| 37 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; | |
| 38 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; | |
| 39 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, | |
| 40 const SkPaint*) SK_OVERRIDE; | |
| 41 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, | |
| 42 const SkRect& dst, const SkPaint* paint, | |
| 43 DrawBitmapRectFlags flags) SK_OVERRIDE; | |
| 44 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, | |
| 45 const SkRect& dst, const SkPaint*) SK_OVERRIDE; | |
| 46 virtual void drawSprite(const SkBitmap&, int left, int top, | |
| 47 const SkPaint*) SK_OVERRIDE; | |
| 48 virtual void drawVertices(VertexMode, int vertexCount, | |
| 49 const SkPoint vertices[], const SkPoint texs[], | |
| 50 const SkColor colors[], SkXfermode*, | |
| 51 const uint16_t indices[], int indexCount, | |
| 52 const SkPaint&) SK_OVERRIDE; | |
| 53 virtual void beginCommentGroup(const char* description) SK_OVERRIDE; | 32 virtual void beginCommentGroup(const char* description) SK_OVERRIDE; |
| 54 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; | 33 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
| 55 virtual void endCommentGroup() SK_OVERRIDE; | 34 virtual void endCommentGroup() SK_OVERRIDE; |
| 56 | 35 |
| 57 const SkTDArray<const SkPicture* >& getPictureRefs() const { | 36 const SkTDArray<const SkPicture* >& getPictureRefs() const { |
| 58 return fPictureRefs; | 37 return fPictureRefs; |
| 59 } | 38 } |
| 60 | 39 |
| 61 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { | 40 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { |
| 62 return fTextBlobRefs; | 41 return fTextBlobRefs; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 SkScalar constY, const SkPaint&) SK_OVERRIDE; | 168 SkScalar constY, const SkPaint&) SK_OVERRIDE; |
| 190 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, | 169 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, |
| 191 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; | 170 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; |
| 192 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 171 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 193 const SkPaint& paint) SK_OVERRIDE; | 172 const SkPaint& paint) SK_OVERRIDE; |
| 194 | 173 |
| 195 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 174 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 196 const SkPoint texCoords[4], SkXfermode* xmode, | 175 const SkPoint texCoords[4], SkXfermode* xmode, |
| 197 const SkPaint& paint) SK_OVERRIDE; | 176 const SkPaint& paint) SK_OVERRIDE; |
| 198 | 177 |
| 178 void onDrawPaint(const SkPaint&) SK_OVERRIDE; |
| 179 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPain
t&) SK_OVERRIDE; |
| 180 void onDrawRect(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 181 void onDrawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; |
| 182 void onDrawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; |
| 183 void onDrawPath(const SkPath&, const SkPaint&) SK_OVERRIDE; |
| 184 void onDrawBitmap(const SkBitmap&, SkScalar left, SkScalar top, const SkPain
t*) SK_OVERRIDE; |
| 185 void onDrawBitmapRect(const SkBitmap&, const SkRect* src, const SkRect& dst,
const SkPaint*, |
| 186 DrawBitmapRectFlags flags) SK_OVERRIDE; |
| 187 #if 0 |
| 188 // rely on conversion to bitmap (for now) |
| 189 void onDrawImage(const SkImage*, SkScalar left, SkScalar top, const SkPaint*
) SK_OVERRIDE; |
| 190 void onDrawImageRect(const SkImage*, const SkRect* src, const SkRect& dst, |
| 191 const SkPaint*) SK_OVERRIDE; |
| 192 #endif |
| 193 void onDrawBitmapNine(const SkBitmap&, const SkIRect& center, const SkRect&
dst, |
| 194 const SkPaint*) SK_OVERRIDE; |
| 195 void onDrawSprite(const SkBitmap&, int left, int top, const SkPaint*) SK_OVE
RRIDE; |
| 196 void onDrawVertices(VertexMode vmode, int vertexCount, |
| 197 const SkPoint vertices[], const SkPoint texs[], |
| 198 const SkColor colors[], SkXfermode* xmode, |
| 199 const uint16_t indices[], int indexCount, |
| 200 const SkPaint&) SK_OVERRIDE; |
| 201 |
| 199 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 202 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 200 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; | 203 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
| 201 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 204 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 202 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; | 205 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; |
| 203 | 206 |
| 204 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; | 207 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; |
| 205 | 208 |
| 206 int addPathToHeap(const SkPath& path); // does not write to ops stream | 209 int addPathToHeap(const SkPath& path); // does not write to ops stream |
| 207 | 210 |
| 208 // These entry points allow the writing of matrices, clips, saves & | 211 // These entry points allow the writing of matrices, clips, saves & |
| (...skipping 25 matching lines...) Expand all Loading... |
| 234 | 237 |
| 235 uint32_t fRecordFlags; | 238 uint32_t fRecordFlags; |
| 236 int fInitialSaveCount; | 239 int fInitialSaveCount; |
| 237 | 240 |
| 238 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor | 241 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor |
| 239 | 242 |
| 240 typedef SkCanvas INHERITED; | 243 typedef SkCanvas INHERITED; |
| 241 }; | 244 }; |
| 242 | 245 |
| 243 #endif | 246 #endif |
| OLD | NEW |