| 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 29 matching lines...) Expand all Loading... |
| 40 // types polymorphically. (See SkRecord::Record::{visit,mutate} for an example.
) | 40 // types polymorphically. (See SkRecord::Record::{visit,mutate} for an example.
) |
| 41 // | 41 // |
| 42 // Order doesn't technically matter here, but the compiler can generally generat
e better code if | 42 // Order doesn't technically matter here, but the compiler can generally generat
e better code if |
| 43 // you keep them semantically grouped, especially the Draws. It's also nice to
leave NoOp at 0. | 43 // you keep them semantically grouped, especially the Draws. It's also nice to
leave NoOp at 0. |
| 44 #define SK_RECORD_TYPES(M) \ | 44 #define SK_RECORD_TYPES(M) \ |
| 45 M(NoOp) \ | 45 M(NoOp) \ |
| 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) \ | |
| 51 M(Concat) \ | 50 M(Concat) \ |
| 52 M(ClipPath) \ | 51 M(ClipPath) \ |
| 53 M(ClipRRect) \ | 52 M(ClipRRect) \ |
| 54 M(ClipRect) \ | 53 M(ClipRect) \ |
| 55 M(ClipRegion) \ | 54 M(ClipRegion) \ |
| 56 M(DrawBitmap) \ | 55 M(DrawBitmap) \ |
| 57 M(DrawBitmapNine) \ | 56 M(DrawBitmapNine) \ |
| 58 M(DrawBitmapRect) \ | 57 M(DrawBitmapRect) \ |
| 59 M(DrawBitmapRectFast) \ | 58 M(DrawBitmapRectFast) \ |
| 60 M(DrawBitmapRectFixedSize) \ | 59 M(DrawBitmapRectFixedSize) \ |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 Optional<SkRect> bounds; | 211 Optional<SkRect> bounds; |
| 213 Optional<SkPaint> paint; | 212 Optional<SkPaint> paint; |
| 214 RefBox<const SkImageFilter> backdrop; | 213 RefBox<const SkImageFilter> backdrop; |
| 215 SkCanvas::SaveLayerFlags saveLayerFlags); | 214 SkCanvas::SaveLayerFlags saveLayerFlags); |
| 216 | 215 |
| 217 RECORD(SetMatrix, 0, | 216 RECORD(SetMatrix, 0, |
| 218 TypedMatrix matrix); | 217 TypedMatrix matrix); |
| 219 RECORD(Concat, 0, | 218 RECORD(Concat, 0, |
| 220 TypedMatrix matrix); | 219 TypedMatrix matrix); |
| 221 | 220 |
| 222 RECORD(TranslateZ, 0, SkScalar z); | |
| 223 | |
| 224 struct RegionOpAndAA { | 221 struct RegionOpAndAA { |
| 225 RegionOpAndAA() {} | 222 RegionOpAndAA() {} |
| 226 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} | 223 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} |
| 227 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win
today to do so. | 224 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win
today to do so. |
| 228 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t
his an unsigned. | 225 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t
his an unsigned. |
| 229 }; | 226 }; |
| 230 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize"); | 227 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize"); |
| 231 | 228 |
| 232 RECORD(ClipPath, 0, | 229 RECORD(ClipPath, 0, |
| 233 SkIRect devBounds; | 230 SkIRect devBounds; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 int indexCount); | 378 int indexCount); |
| 382 RECORD(DrawAnnotation, 0, | 379 RECORD(DrawAnnotation, 0, |
| 383 SkRect rect; | 380 SkRect rect; |
| 384 SkString key; | 381 SkString key; |
| 385 RefBox<SkData> value); | 382 RefBox<SkData> value); |
| 386 #undef RECORD | 383 #undef RECORD |
| 387 | 384 |
| 388 } // namespace SkRecords | 385 } // namespace SkRecords |
| 389 | 386 |
| 390 #endif//SkRecords_DEFINED | 387 #endif//SkRecords_DEFINED |
| OLD | NEW |