OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkData.h" | 9 #include "SkData.h" |
10 #include "SkImageFilter.h" | 10 #include "SkImageFilter.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 // Helper for getting back at arrays which have been copy_v'd together after an
Op. | 38 // Helper for getting back at arrays which have been copy_v'd together after an
Op. |
39 template <typename D, typename T> | 39 template <typename D, typename T> |
40 static D* pod(T* op, size_t offset = 0) { | 40 static D* pod(T* op, size_t offset = 0) { |
41 return SkTAddOffset<D>(op+1, offset); | 41 return SkTAddOffset<D>(op+1, offset); |
42 } | 42 } |
43 | 43 |
44 // Pre-cache lazy non-threadsafe fields on SkPath and/or SkMatrix. | 44 // Pre-cache lazy non-threadsafe fields on SkPath and/or SkMatrix. |
45 static void make_threadsafe(SkPath* path, SkMatrix* matrix) { | 45 static void make_threadsafe(SkPath* path, SkMatrix* matrix) { |
46 if (path) { | 46 if (path) { path->updateBoundsCache(); } |
47 path->updateBoundsCache(); | |
48 (void)path->getConvexity(); | |
49 } | |
50 if (matrix) { (void)matrix->getType(); } | 47 if (matrix) { (void)matrix->getType(); } |
51 } | 48 } |
52 | 49 |
53 namespace { | 50 namespace { |
54 #define TYPES(M)
\ | 51 #define TYPES(M)
\ |
55 M(Save) M(Restore) M(SaveLayer)
\ | 52 M(Save) M(Restore) M(SaveLayer)
\ |
56 M(Concat) M(SetMatrix) M(Translate) M(TranslateZ)
\ | 53 M(Concat) M(SetMatrix) M(Translate) M(TranslateZ)
\ |
57 M(ClipPath) M(ClipRect) M(ClipRRect) M(ClipRegion)
\ | 54 M(ClipPath) M(ClipRect) M(ClipRRect) M(ClipRegion)
\ |
58 M(DrawPaint) M(DrawPath) M(DrawRect) M(DrawRegion) M(DrawOval) M(DrawArc)
\ | 55 M(DrawPaint) M(DrawPath) M(DrawRect) M(DrawRegion) M(DrawOval) M(DrawArc)
\ |
59 M(DrawRRect) M(DrawDRRect) M(DrawAnnotation) M(DrawDrawable) M(DrawPicture)
\ | 56 M(DrawRRect) M(DrawDRRect) M(DrawAnnotation) M(DrawDrawable) M(DrawPicture)
\ |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 } | 783 } |
787 | 784 |
788 void SkLiteDL::reset(SkRect bounds) { | 785 void SkLiteDL::reset(SkRect bounds) { |
789 SkASSERT(this->unique()); | 786 SkASSERT(this->unique()); |
790 this->map(dtor_fns); | 787 this->map(dtor_fns); |
791 | 788 |
792 // Leave fBytes and fReserved alone. | 789 // Leave fBytes and fReserved alone. |
793 fUsed = 0; | 790 fUsed = 0; |
794 fBounds = bounds; | 791 fBounds = bounds; |
795 } | 792 } |
OLD | NEW |