Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkPictureAnalyzer.h
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 "SkCanvas.h"
12 #include "SkRefCnt.h"
13 #include "SkRegion.h"
14 #include "SkTypes.h"
15 
16 #if SK_SUPPORT_GPU
17 #include "GrContext.h"
18 
19 class SkPath;
20 class SkPicture;
21 
26 class SK_API SkPictureGpuAnalyzer final : public SkNoncopyable {
27 public:
29  explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture,
31 
35  void analyzePicture(const SkPicture*);
36 
40  void analyzeClipPath(const SkPath&, SkClipOp, bool doAntiAlias);
41 
45  void reset();
46 
50  bool suitableForGpuRasterization(const char** whyNot = nullptr) const;
51 
56  uint32_t numSlowGpuCommands() { return fNumSlowPaths; }
57 
58 private:
59  uint32_t fNumSlowPaths;
60 
61  typedef SkNoncopyable INHERITED;
62 };
63 
64 #endif // SK_SUPPORT_GPU
65 
66 #endif // SkPictureAnalyzer_DEFINED
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:25
An SkPicture records drawing commands made to a canvas to be played back at a later time...
Definition: SkPicture.h:38
uint32_t numSlowGpuCommands()
Returns the number of commands which are slow to draw on the GPU, capped at the predicate max...
Definition: SkPictureAnalyzer.h:56
Gathers GPU-related statistics for one or more SkPictures.
Definition: SkPictureAnalyzer.h:26