Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2016 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef SkPictureAnalyzer_DEFINED | |
| 9 #define SkPictureAnalyzer_DEFINED | |
| 10 | |
| 11 #include "SkRefCnt.h" | |
| 12 #include "SkTypes.h" | |
| 13 | |
| 14 class GrContextThreadSafeProxy; | |
| 15 class SkPicture; | |
| 16 | |
| 17 /** \class SkPictureGpuAnalyzer | |
| 18 | |
| 19 Gathers GPU-related statistics for one or more SkPictures. | |
| 20 */ | |
| 21 class SK_API SkPictureGpuAnalyzer final : public SkNoncopyable { | |
| 22 public: | |
| 23 explicit SkPictureGpuAnalyzer(GrContextThreadSafeProxy* = nullptr); | |
|
bsalomon
2016/05/13 16:14:27
sk_sp<GrContextThreadSafeProxy>?
f(malita)
2016/05/13 16:59:16
Done. This also forced me to think about non-SK_S
| |
| 24 explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture, | |
| 25 GrContextThreadSafeProxy* = nullptr); | |
| 26 | |
| 27 /** | |
| 28 * Process the given picture and accumulate its stats. | |
| 29 */ | |
| 30 void analyze(const SkPicture*); | |
| 31 | |
| 32 /** | |
| 33 * Reset all accumulated stats. | |
| 34 */ | |
| 35 void reset(); | |
| 36 | |
| 37 /** | |
| 38 * Returns true if the analyzed pictures are suitable for rendering on the GPU. | |
| 39 */ | |
| 40 bool suitableForGpuRasterization(const char** whyNot = nullptr) const; | |
| 41 | |
| 42 private: | |
| 43 uint32_t fNumSlowPaths; | |
| 44 | |
| 45 typedef SkNoncopyable INHERITED; | |
| 46 }; | |
| 47 | |
| 48 #endif // SkPictureAnalyzer_DEFINED | |
| OLD | NEW |