Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1067)

Unified Diff: src/core/SkPictureContentInfo.h

Issue 435093003: Keep track of the number of skia operations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed the return type of numOperations Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkPictureContentInfo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureContentInfo.h
diff --git a/src/core/SkPictureContentInfo.h b/src/core/SkPictureContentInfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..cfeedcf48312317ca0c4684b7cb536c5c78aa297
--- /dev/null
+++ b/src/core/SkPictureContentInfo.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPictureContentInfo_DEFINED
+#define SkPictureContentInfo_DEFINED
+
+class GrContext;
+
+class SkPictureContentInfo {
+public:
+ SkPictureContentInfo() { this->reset(); }
+ SkPictureContentInfo(const SkPictureContentInfo& src) { this->set(src); }
+
+ int numOperations() const { return fNumOperations; }
+ bool hasText() const { return fNumTexts > 0; }
+ bool suitableForGpuRasterization(GrContext* context, const char **reason,
+ int sampleCount) const;
+
+ void addOperation() { ++fNumOperations; }
+
+ void onDrawPoints(size_t count, const SkPaint& paint);
+ void onDrawPath(const SkPath& path, const SkPaint& paint);
+ void onAddPaintPtr(const SkPaint* paint);
+ void onDrawText() { ++fNumTexts; }
+
+ void set(const SkPictureContentInfo& src);
+ void reset();
+ void swap(SkPictureContentInfo* other);
+
+private:
+ // Raw count of operations in the picture
+ int fNumOperations;
+ // Count of all forms of drawText
+ int fNumTexts;
+
+ // This field is incremented every time a paint with a path effect is
+ // used (i.e., it is not a de-duplicated count)
+ int fNumPaintWithPathEffectUses;
+ // This field is incremented every time a paint with a path effect that is
+ // dashed, we are drawing a line, and we can use the gpu fast path
+ int fNumFastPathDashEffects;
+ // This field is incremented every time an anti-aliased drawPath call is
+ // issued with a concave path
+ int fNumAAConcavePaths;
+ // This field is incremented every time a drawPath call is
+ // issued for a hairline stroked concave path.
+ int fNumAAHairlineConcavePaths;
+};
+
+#endif
« no previous file with comments | « gyp/core.gypi ('k') | src/core/SkPictureContentInfo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698