| 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; |
| 32 virtual void beginCommentGroup(const char* description) SK_OVERRIDE; | 53 virtual void beginCommentGroup(const char* description) SK_OVERRIDE; |
| 33 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; | 54 virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE; |
| 34 virtual void endCommentGroup() SK_OVERRIDE; | 55 virtual void endCommentGroup() SK_OVERRIDE; |
| 35 | 56 |
| 36 const SkTDArray<const SkPicture* >& getPictureRefs() const { | 57 const SkTDArray<const SkPicture* >& getPictureRefs() const { |
| 37 return fPictureRefs; | 58 return fPictureRefs; |
| 38 } | 59 } |
| 39 | 60 |
| 40 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { | 61 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { |
| 41 return fTextBlobRefs; | 62 return fTextBlobRefs; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 SkScalar constY, const SkPaint&) SK_OVERRIDE; | 189 SkScalar constY, const SkPaint&) SK_OVERRIDE; |
| 169 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, | 190 virtual void onDrawTextOnPath(const void* text, size_t byteLength, const SkP
ath& path, |
| 170 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; | 191 const SkMatrix* matrix, const SkPaint&) SK_OVE
RRIDE; |
| 171 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, | 192 virtual void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y, |
| 172 const SkPaint& paint) SK_OVERRIDE; | 193 const SkPaint& paint) SK_OVERRIDE; |
| 173 | 194 |
| 174 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], | 195 virtual void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], |
| 175 const SkPoint texCoords[4], SkXfermode* xmode, | 196 const SkPoint texCoords[4], SkXfermode* xmode, |
| 176 const SkPaint& paint) SK_OVERRIDE; | 197 const SkPaint& paint) SK_OVERRIDE; |
| 177 | 198 |
| 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 | |
| 202 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 199 virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 203 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; | 200 virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVE
RRIDE; |
| 204 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; | 201 virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERR
IDE; |
| 205 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; | 202 virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE; |
| 206 | 203 |
| 207 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; | 204 virtual void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*
) SK_OVERRIDE; |
| 208 | 205 |
| 209 int addPathToHeap(const SkPath& path); // does not write to ops stream | 206 int addPathToHeap(const SkPath& path); // does not write to ops stream |
| 210 | 207 |
| 211 // These entry points allow the writing of matrices, clips, saves & | 208 // These entry points allow the writing of matrices, clips, saves & |
| (...skipping 25 matching lines...) Expand all Loading... |
| 237 | 234 |
| 238 uint32_t fRecordFlags; | 235 uint32_t fRecordFlags; |
| 239 int fInitialSaveCount; | 236 int fInitialSaveCount; |
| 240 | 237 |
| 241 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor | 238 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c
onstructor |
| 242 | 239 |
| 243 typedef SkCanvas INHERITED; | 240 typedef SkCanvas INHERITED; |
| 244 }; | 241 }; |
| 245 | 242 |
| 246 #endif | 243 #endif |
| OLD | NEW |