Skia
2DGraphicsLibrary
 All Classes 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 "SkRefCnt.h"
12 #include "SkRegion.h"
13 #include "SkTypes.h"
14 
15 #if SK_SUPPORT_GPU
16 #include "GrContext.h"
17 
18 class SkPath;
19 class SkPicture;
20 
25 class SK_API SkPictureGpuAnalyzer final : public SkNoncopyable {
26 public:
28  explicit SkPictureGpuAnalyzer(const sk_sp<SkPicture>& picture,
30 
34  void analyzePicture(const SkPicture*);
35 
39  void analyzeClipPath(const SkPath&, SkRegion::Op, bool doAntiAlias);
40 
44  void reset();
45 
49  bool suitableForGpuRasterization(const char** whyNot = nullptr) const;
50 
55  uint32_t numSlowGpuCommands() { return fNumSlowPaths; }
56 
57 private:
58  uint32_t fNumSlowPaths;
59 
60  typedef SkNoncopyable INHERITED;
61 };
62 
63 #endif // SK_SUPPORT_GPU
64 
65 #endif // SkPictureAnalyzer_DEFINED
The SkPath class encapsulates compound (multiple contour) geometric paths consisting of straight line...
Definition: SkPath.h:27
An SkPicture records drawing commands made to a canvas to be played back at a later time...
Definition: SkPicture.h:38
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:258
uint32_t numSlowGpuCommands()
Returns the number of commands which are slow to draw on the GPU, capped at the predicate max...
Definition: SkPictureAnalyzer.h:55
Op
The logical operations that can be performed when combining two regions.
Definition: SkRegion.h:239
Gathers GPU-related statistics for one or more SkPictures.
Definition: SkPictureAnalyzer.h:25