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 GrContext; | |
| 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 SkPictureGpuAnalyzer(); | |
| 24 explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture); | |
| 25 | |
| 26 /** | |
| 27 * Process the given picture and accumulate its stats. | |
| 28 */ | |
| 29 void analyze(const SkPicture*); | |
| 30 | |
| 31 /** | |
| 32 * Reset all accumulated stats. | |
| 33 */ | |
| 34 void reset(); | |
| 35 | |
| 36 /** | |
| 37 * Returns true if the analyzed pictures are suitable for rendering on the GPU. | |
| 38 */ | |
| 39 bool suitableForGpuRasterization(GrContext*, const char** whyNot = nullptr) const; | |
|
bsalomon
2016/05/12 20:59:02
Should we take the GrContext* in the constructor i
f(malita)
2016/05/12 21:15:19
Done.
| |
| 40 | |
| 41 private: | |
| 42 uint32_t fNumSlowPaths; | |
| 43 | |
| 44 typedef SkNoncopyable INHERITED; | |
| 45 }; | |
| 46 | |
| 47 #endif // SkPictureAnalyzer_DEFINED | |
| OLD | NEW |