| 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(Translate) \ |
| 50 M(TranslateZ) \ | 51 M(TranslateZ) \ |
| 51 M(Concat) \ | 52 M(Concat) \ |
| 52 M(ClipPath) \ | 53 M(ClipPath) \ |
| 53 M(ClipRRect) \ | 54 M(ClipRRect) \ |
| 54 M(ClipRect) \ | 55 M(ClipRect) \ |
| 55 M(ClipRegion) \ | 56 M(ClipRegion) \ |
| 56 M(DrawDrawable) \ | 57 M(DrawDrawable) \ |
| 57 M(DrawImage) \ | 58 M(DrawImage) \ |
| 58 M(DrawImageLattice) \ | 59 M(DrawImageLattice) \ |
| 59 M(DrawImageRect) \ | 60 M(DrawImageRect) \ |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 Optional<SkRect> bounds; | 176 Optional<SkRect> bounds; |
| 176 Optional<SkPaint> paint; | 177 Optional<SkPaint> paint; |
| 177 sk_sp<const SkImageFilter> backdrop; | 178 sk_sp<const SkImageFilter> backdrop; |
| 178 SkCanvas::SaveLayerFlags saveLayerFlags); | 179 SkCanvas::SaveLayerFlags saveLayerFlags); |
| 179 | 180 |
| 180 RECORD(SetMatrix, 0, | 181 RECORD(SetMatrix, 0, |
| 181 TypedMatrix matrix); | 182 TypedMatrix matrix); |
| 182 RECORD(Concat, 0, | 183 RECORD(Concat, 0, |
| 183 TypedMatrix matrix); | 184 TypedMatrix matrix); |
| 184 | 185 |
| 186 RECORD(Translate, 0, |
| 187 SkScalar dx; |
| 188 SkScalar dy); |
| 185 RECORD(TranslateZ, 0, SkScalar z); | 189 RECORD(TranslateZ, 0, SkScalar z); |
| 186 | 190 |
| 187 struct RegionOpAndAA { | 191 struct RegionOpAndAA { |
| 188 RegionOpAndAA() {} | 192 RegionOpAndAA() {} |
| 189 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} | 193 RegionOpAndAA(SkRegion::Op op, bool aa) : op(op), aa(aa) {} |
| 190 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win
today to do so. | 194 SkRegion::Op op : 31; // This really only needs to be 3, but there's no win
today to do so. |
| 191 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t
his an unsigned. | 195 unsigned aa : 1; // MSVC won't pack an enum with an bool, so we call t
his an unsigned. |
| 192 }; | 196 }; |
| 193 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize"); | 197 static_assert(sizeof(RegionOpAndAA) == 4, "RegionOpAndAASize"); |
| 194 | 198 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 int indexCount); | 334 int indexCount); |
| 331 RECORD(DrawAnnotation, 0, // TODO: kDraw_Tag, skia:5548 | 335 RECORD(DrawAnnotation, 0, // TODO: kDraw_Tag, skia:5548 |
| 332 SkRect rect; | 336 SkRect rect; |
| 333 SkString key; | 337 SkString key; |
| 334 sk_sp<SkData> value); | 338 sk_sp<SkData> value); |
| 335 #undef RECORD | 339 #undef RECORD |
| 336 | 340 |
| 337 } // namespace SkRecords | 341 } // namespace SkRecords |
| 338 | 342 |
| 339 #endif//SkRecords_DEFINED | 343 #endif//SkRecords_DEFINED |
| OLD | NEW |