OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkRecords_DEFINED | 8 #ifndef SkRecords_DEFINED |
9 #define SkRecords_DEFINED | 9 #define SkRecords_DEFINED |
10 | 10 |
11 #include "SkData.h" | |
12 #include "SkCanvas.h" | 11 #include "SkCanvas.h" |
13 #include "SkDrawable.h" | 12 #include "SkDrawable.h" |
14 #include "SkImageFilter.h" | 13 #include "SkImageFilter.h" |
15 #include "SkMatrix.h" | 14 #include "SkMatrix.h" |
16 #include "SkPath.h" | 15 #include "SkPath.h" |
17 #include "SkPicture.h" | 16 #include "SkPicture.h" |
18 #include "SkRect.h" | 17 #include "SkRect.h" |
19 #include "SkRRect.h" | 18 #include "SkRRect.h" |
20 #include "SkRSXform.h" | 19 #include "SkRSXform.h" |
21 #include "SkString.h" | |
22 #include "SkTextBlob.h" | 20 #include "SkTextBlob.h" |
23 | 21 |
24 namespace SkRecords { | 22 namespace SkRecords { |
25 | 23 |
26 // A list of all the types of canvas calls we can record. | 24 // A list of all the types of canvas calls we can record. |
27 // Each of these is reified into a struct below. | 25 // Each of these is reified into a struct below. |
28 // | 26 // |
29 // (We're using the macro-of-macro trick here to do several different things wit
h the same list.) | 27 // (We're using the macro-of-macro trick here to do several different things wit
h the same list.) |
30 // | 28 // |
31 // We leave this SK_RECORD_TYPES macro defined for use by code that wants to ope
rate on SkRecords | 29 // We leave this SK_RECORD_TYPES macro defined for use by code that wants to ope
rate on SkRecords |
(...skipping 29 matching lines...) Expand all Loading... |
61 M(DrawPicture) \ | 59 M(DrawPicture) \ |
62 M(DrawPoints) \ | 60 M(DrawPoints) \ |
63 M(DrawPosText) \ | 61 M(DrawPosText) \ |
64 M(DrawPosTextH) \ | 62 M(DrawPosTextH) \ |
65 M(DrawText) \ | 63 M(DrawText) \ |
66 M(DrawTextOnPath) \ | 64 M(DrawTextOnPath) \ |
67 M(DrawRRect) \ | 65 M(DrawRRect) \ |
68 M(DrawRect) \ | 66 M(DrawRect) \ |
69 M(DrawTextBlob) \ | 67 M(DrawTextBlob) \ |
70 M(DrawAtlas) \ | 68 M(DrawAtlas) \ |
71 M(DrawVertices) \ | 69 M(DrawVertices) |
72 M(DrawAnnotation) | |
73 | 70 |
74 // Defines SkRecords::Type, an enum of all record types. | 71 // Defines SkRecords::Type, an enum of all record types. |
75 #define ENUM(T) T##_Type, | 72 #define ENUM(T) T##_Type, |
76 enum Type { SK_RECORD_TYPES(ENUM) }; | 73 enum Type { SK_RECORD_TYPES(ENUM) }; |
77 #undef ENUM | 74 #undef ENUM |
78 | 75 |
79 #define ACT_AS_PTR(ptr) \ | 76 #define ACT_AS_PTR(ptr) \ |
80 operator T*() const { return ptr; } \ | 77 operator T*() const { return ptr; } \ |
81 T* operator->() const { return ptr; } | 78 T* operator->() const { return ptr; } |
82 | 79 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 RECORD(DrawVertices, kDraw_Tag, | 351 RECORD(DrawVertices, kDraw_Tag, |
355 SkPaint paint; | 352 SkPaint paint; |
356 SkCanvas::VertexMode vmode; | 353 SkCanvas::VertexMode vmode; |
357 int vertexCount; | 354 int vertexCount; |
358 PODArray<SkPoint> vertices; | 355 PODArray<SkPoint> vertices; |
359 PODArray<SkPoint> texs; | 356 PODArray<SkPoint> texs; |
360 PODArray<SkColor> colors; | 357 PODArray<SkColor> colors; |
361 RefBox<SkXfermode> xmode; | 358 RefBox<SkXfermode> xmode; |
362 PODArray<uint16_t> indices; | 359 PODArray<uint16_t> indices; |
363 int indexCount); | 360 int indexCount); |
364 RECORD(DrawAnnotation, 0, | 361 |
365 SkRect rect; | |
366 SkString key; | |
367 RefBox<SkData> value); | |
368 #undef RECORD | 362 #undef RECORD |
369 | 363 |
370 } // namespace SkRecords | 364 } // namespace SkRecords |
371 | 365 |
372 #endif//SkRecords_DEFINED | 366 #endif//SkRecords_DEFINED |
OLD | NEW |