aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureData.h
diff options
context:
space:
mode:
authorGravatar hendrikw <hendrikw@chromium.org>2014-08-08 10:44:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-08 10:44:33 -0700
commitafdada2eabdef47a59e08c884b2beb1af3f31aa5 (patch)
treece35abed8ff83b9fda93960b2551f359aae36b3f /src/core/SkPictureData.h
parentf4078ad1ec42f549369ac4f639aab18d00afae95 (diff)
Moved SkPictureContentInfo into its own file. It now tracks the number of skia
operations (maybe, I'm not 100% sure I'm doing this right yet) and the number of text draws. I also moved some of the gpu logic out of SkPictureRecord and into SkPictureContentInfo, http://code.google.com/p/chromium/issues/detail?id=396908 http://code.google.com/p/chromium/issues/detail?id=397198 http://code.google.com/p/chromium/issues/detail?id=399728 BUG=396908 R=nduca@chromium.org, mtklein@chromium.org, robertphillips@google.com, mtklein@google.com Author: hendrikw@chromium.org Review URL: https://codereview.chromium.org/435093003
Diffstat (limited to 'src/core/SkPictureData.h')
-rw-r--r--src/core/SkPictureData.h60
1 files changed, 1 insertions, 59 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index 6ea0b18b03..c1cfba35fb 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -11,6 +11,7 @@
#include "SkBitmap.h"
#include "SkPathHeap.h"
#include "SkPicture.h"
+#include "SkPictureContentInfo.h"
#include "SkPictureFlat.h"
#include "SkPictureStateTree.h"
@@ -55,65 +56,6 @@ struct SkPictInfo {
// Always write this guy last (with no length field afterwards)
#define SK_PICT_EOF_TAG SkSetFourByteTag('e', 'o', 'f', ' ')
-// SkPictureContentInfo is not serialized! It is intended solely for use
-// with suitableForGpuRasterization.
-class SkPictureContentInfo {
-public:
- SkPictureContentInfo() { this->reset(); }
-
- SkPictureContentInfo(const SkPictureContentInfo& src) { this->set(src); }
-
- void set(const SkPictureContentInfo& src) {
- fNumPaintWithPathEffectUses = src.fNumPaintWithPathEffectUses;
- fNumFastPathDashEffects = src.fNumFastPathDashEffects;
- fNumAAConcavePaths = src.fNumAAConcavePaths;
- fNumAAHairlineConcavePaths = src.fNumAAHairlineConcavePaths;
- }
-
- void reset() {
- fNumPaintWithPathEffectUses = 0;
- fNumFastPathDashEffects = 0;
- fNumAAConcavePaths = 0;
- fNumAAHairlineConcavePaths = 0;
- }
-
- void swap(SkPictureContentInfo* other) {
- SkTSwap(fNumPaintWithPathEffectUses, other->fNumPaintWithPathEffectUses);
- SkTSwap(fNumFastPathDashEffects, other->fNumFastPathDashEffects);
- SkTSwap(fNumAAConcavePaths, other->fNumAAConcavePaths);
- SkTSwap(fNumAAHairlineConcavePaths, other->fNumAAHairlineConcavePaths);
- }
-
- void incPaintWithPathEffectUses() { ++fNumPaintWithPathEffectUses; }
- int numPaintWithPathEffectUses() const { return fNumPaintWithPathEffectUses; }
-
- void incFastPathDashEffects() { ++fNumFastPathDashEffects; }
- int numFastPathDashEffects() const { return fNumFastPathDashEffects; }
-
- void incAAConcavePaths() { ++fNumAAConcavePaths; }
- int numAAConcavePaths() const { return fNumAAConcavePaths; }
-
- void incAAHairlineConcavePaths() {
- ++fNumAAHairlineConcavePaths;
- SkASSERT(fNumAAHairlineConcavePaths <= fNumAAConcavePaths);
- }
- int numAAHairlineConcavePaths() const { return fNumAAHairlineConcavePaths; }
-
-private:
- // 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;
-};
-
#ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
/**
* Container for data that is needed to deep copy a SkPicture. The container