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 #ifndef SkPictureAnalyzer_DEFINED | 8 #ifndef SkPictureAnalyzer_DEFINED |
9 #define SkPictureAnalyzer_DEFINED | 9 #define SkPictureAnalyzer_DEFINED |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 explicit SkPictureGpuAnalyzer(sk_sp<GrContextThreadSafeProxy> = nullptr); | 27 explicit SkPictureGpuAnalyzer(sk_sp<GrContextThreadSafeProxy> = nullptr); |
28 explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture, | 28 explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture, |
29 sk_sp<GrContextThreadSafeProxy> = nullptr); | 29 sk_sp<GrContextThreadSafeProxy> = nullptr); |
30 | 30 |
31 /** | 31 /** |
32 * Process the given picture and accumulate its stats. | 32 * Process the given picture and accumulate its stats. |
33 */ | 33 */ |
34 void analyzePicture(const SkPicture*); | 34 void analyzePicture(const SkPicture*); |
35 | 35 |
36 // Legacy/transitional alias. | |
37 void analyze(const SkPicture* picture) { this->analyzePicture(picture); } | |
38 | |
39 /** | 36 /** |
40 * Process an explicit clipPath op. | 37 * Process an explicit clipPath op. |
41 */ | 38 */ |
42 void analyzeClipPath(const SkPath&, SkRegion::Op, bool doAntiAlias); | 39 void analyzeClipPath(const SkPath&, SkRegion::Op, bool doAntiAlias); |
43 | 40 |
44 /** | 41 /** |
45 * Reset all accumulated stats. | 42 * Reset all accumulated stats. |
46 */ | 43 */ |
47 void reset(); | 44 void reset(); |
48 | 45 |
49 /** | 46 /** |
50 * Returns true if the analyzed pictures are suitable for rendering on the
GPU. | 47 * Returns true if the analyzed pictures are suitable for rendering on the
GPU. |
51 */ | 48 */ |
52 bool suitableForGpuRasterization(const char** whyNot = nullptr) const; | 49 bool suitableForGpuRasterization(const char** whyNot = nullptr) const; |
53 | 50 |
54 private: | 51 private: |
55 uint32_t fNumSlowPaths; | 52 uint32_t fNumSlowPaths; |
56 | 53 |
57 typedef SkNoncopyable INHERITED; | 54 typedef SkNoncopyable INHERITED; |
58 }; | 55 }; |
59 | 56 |
60 #endif // SK_SUPPORT_GPU | 57 #endif // SK_SUPPORT_GPU |
61 | 58 |
62 #endif // SkPictureAnalyzer_DEFINED | 59 #endif // SkPictureAnalyzer_DEFINED |
OLD | NEW |