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 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 M(Restore) \ | 46 M(Restore) \ |
47 M(Save) \ | 47 M(Save) \ |
48 M(SaveLayer) \ | 48 M(SaveLayer) \ |
49 M(SetMatrix) \ | 49 M(SetMatrix) \ |
50 M(TranslateZ) \ | 50 M(TranslateZ) \ |
51 M(Concat) \ | 51 M(Concat) \ |
52 M(ClipPath) \ | 52 M(ClipPath) \ |
53 M(ClipRRect) \ | 53 M(ClipRRect) \ |
54 M(ClipRect) \ | 54 M(ClipRect) \ |
55 M(ClipRegion) \ | 55 M(ClipRegion) \ |
56 M(DrawBitmap) \ | |
57 M(DrawBitmapNine) \ | |
58 M(DrawBitmapRect) \ | |
59 M(DrawBitmapRectFast) \ | |
60 M(DrawBitmapRectFixedSize) \ | |
61 M(DrawDrawable) \ | 56 M(DrawDrawable) \ |
62 M(DrawImage) \ | 57 M(DrawImage) \ |
63 M(DrawImageRect) \ | 58 M(DrawImageRect) \ |
64 M(DrawImageNine) \ | 59 M(DrawImageNine) \ |
65 M(DrawDRRect) \ | 60 M(DrawDRRect) \ |
66 M(DrawOval) \ | 61 M(DrawOval) \ |
67 M(DrawPaint) \ | 62 M(DrawPaint) \ |
68 M(DrawPath) \ | 63 M(DrawPath) \ |
69 M(DrawPatch) \ | 64 M(DrawPatch) \ |
70 M(DrawPicture) \ | 65 M(DrawPicture) \ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 | 145 |
151 ACT_AS_PTR(fPtr); | 146 ACT_AS_PTR(fPtr); |
152 private: | 147 private: |
153 T* fPtr; | 148 T* fPtr; |
154 }; | 149 }; |
155 | 150 |
156 #undef ACT_AS_PTR | 151 #undef ACT_AS_PTR |
157 | 152 |
158 // Like SkBitmap, but deep copies pixels if they're not immutable. | 153 // Like SkBitmap, but deep copies pixels if they're not immutable. |
159 // Using this, we guarantee the immutability of all bitmaps we record. | 154 // Using this, we guarantee the immutability of all bitmaps we record. |
160 class ImmutableBitmap : SkNoncopyable { | 155 class ImmutableBitmap : SkNoncopyable { |
mtklein
2016/07/26 21:16:14
I think this class can die?
reed1
2016/07/28 16:26:45
Done.
| |
161 public: | 156 public: |
162 ImmutableBitmap() {} | 157 ImmutableBitmap() {} |
163 ImmutableBitmap(const SkBitmap& bitmap); | 158 ImmutableBitmap(const SkBitmap& bitmap); |
164 ImmutableBitmap(ImmutableBitmap&& o) { | 159 ImmutableBitmap(ImmutableBitmap&& o) { |
165 fBitmap.swap(o.fBitmap); | 160 fBitmap.swap(o.fBitmap); |
166 } | 161 } |
167 | 162 |
168 int width() const { return fBitmap.width(); } | 163 int width() const { return fBitmap.width(); } |
169 int height() const { return fBitmap.height(); } | 164 int height() const { return fBitmap.height(); } |
170 | 165 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 RECORD(ClipRect, 0, | 236 RECORD(ClipRect, 0, |
242 SkIRect devBounds; | 237 SkIRect devBounds; |
243 SkRect rect; | 238 SkRect rect; |
244 RegionOpAndAA opAA); | 239 RegionOpAndAA opAA); |
245 RECORD(ClipRegion, 0, | 240 RECORD(ClipRegion, 0, |
246 SkIRect devBounds; | 241 SkIRect devBounds; |
247 SkRegion region; | 242 SkRegion region; |
248 SkRegion::Op op); | 243 SkRegion::Op op); |
249 | 244 |
250 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst. | 245 // While not strictly required, if you have an SkPaint, it's fastest to put it f irst. |
251 RECORD(DrawBitmap, kDraw_Tag|kHasImage_Tag, | |
252 Optional<SkPaint> paint; | |
253 ImmutableBitmap bitmap; | |
254 SkScalar left; | |
255 SkScalar top); | |
256 RECORD(DrawBitmapNine, kDraw_Tag|kHasImage_Tag, | |
257 Optional<SkPaint> paint; | |
258 ImmutableBitmap bitmap; | |
259 SkIRect center; | |
260 SkRect dst); | |
261 RECORD(DrawBitmapRect, kDraw_Tag|kHasImage_Tag, | |
262 Optional<SkPaint> paint; | |
263 ImmutableBitmap bitmap; | |
264 Optional<SkRect> src; | |
265 SkRect dst); | |
266 RECORD(DrawBitmapRectFast, kDraw_Tag|kHasImage_Tag, | |
267 Optional<SkPaint> paint; | |
268 ImmutableBitmap bitmap; | |
269 Optional<SkRect> src; | |
270 SkRect dst); | |
271 RECORD(DrawBitmapRectFixedSize, kDraw_Tag|kHasImage_Tag, | |
272 SkPaint paint; | |
273 ImmutableBitmap bitmap; | |
274 SkRect src; | |
275 SkRect dst; | |
276 SkCanvas::SrcRectConstraint constraint); | |
277 RECORD(DrawDRRect, kDraw_Tag, | 246 RECORD(DrawDRRect, kDraw_Tag, |
278 SkPaint paint; | 247 SkPaint paint; |
279 SkRRect outer; | 248 SkRRect outer; |
280 SkRRect inner); | 249 SkRRect inner); |
281 RECORD(DrawDrawable, kDraw_Tag, | 250 RECORD(DrawDrawable, kDraw_Tag, |
282 Optional<SkMatrix> matrix; | 251 Optional<SkMatrix> matrix; |
283 SkRect worstCaseBounds; | 252 SkRect worstCaseBounds; |
284 int32_t index); | 253 int32_t index); |
285 RECORD(DrawImage, kDraw_Tag|kHasImage_Tag, | 254 RECORD(DrawImage, kDraw_Tag|kHasImage_Tag, |
286 Optional<SkPaint> paint; | 255 Optional<SkPaint> paint; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 int indexCount); | 355 int indexCount); |
387 RECORD(DrawAnnotation, 0, | 356 RECORD(DrawAnnotation, 0, |
388 SkRect rect; | 357 SkRect rect; |
389 SkString key; | 358 SkString key; |
390 RefBox<SkData> value); | 359 RefBox<SkData> value); |
391 #undef RECORD | 360 #undef RECORD |
392 | 361 |
393 } // namespace SkRecords | 362 } // namespace SkRecords |
394 | 363 |
395 #endif//SkRecords_DEFINED | 364 #endif//SkRecords_DEFINED |
OLD | NEW |