aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBigPicture.h
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-05-07 17:30:13 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-07 17:30:13 -0700
commitb7ed856fadae52401d3bbcac22cfc3391780ace8 (patch)
treedfea1030ca7eb63ea58f1e733cf741c89273d4df /src/core/SkBigPicture.h
parent8b26b99c97473f020df4b9d4ba789e074e06cedd (diff)
Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #22 id:420001 of https://codereview.chromium.org/1112523006/)
Reason for revert: speculative revert to fix failures in DEPS roll Original issue's description: > Sketch splitting SkPicture into an interface and SkBigPicture. > > Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). > These cover about 89% of draw calls from Blink SKPs, > and about 25% of draw calls from our GMs. > > SkPicture handles: > - serialization and deserialization > - unique IDs > > Everything else is left to the subclasses: > - playback(), cullRect() > - hasBitmap(), hasText(), suitableForGPU(), etc. > - LayerInfo / AccelData if applicable. > > The time to record a 1-op picture improves a good chunk > (2 mallocs to 1), and the time to record a 0-op picture > greatly improves (2 mallocs to none): > > picture_overhead_draw: 450ns -> 350ns > picture_overhead_nodraw: 300ns -> 90ns > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b TBR=reed@google.com,robertphillips@google.com,mtklein@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1130333002
Diffstat (limited to 'src/core/SkBigPicture.h')
-rw-r--r--src/core/SkBigPicture.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/src/core/SkBigPicture.h b/src/core/SkBigPicture.h
deleted file mode 100644
index fb3b62c4c4..0000000000
--- a/src/core/SkBigPicture.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkBigPicture_DEFINED
-#define SkBigPicture_DEFINED
-
-#include "SkPicture.h"
-
-class SkBBoxHierarchy;
-class SkRecord;
-
-// An implementation of SkPicture supporting an arbitrary number of drawing commands.
-class SkBigPicture final : public SkPicture {
-public:
- // AccelData provides a base class for device-specific acceleration data.
- class AccelData : public SkRefCnt { };
-
- // An array of refcounted const SkPicture pointers.
- class SnapshotArray : ::SkNoncopyable {
- public:
- SnapshotArray(const SkPicture* pics[], int count) : fPics(pics), fCount(count) {}
- ~SnapshotArray() { for (int i = 0; i < fCount; i++) { fPics[i]->unref(); } }
-
- const SkPicture* const* begin() const { return fPics; }
- int count() const { return fCount; }
- private:
- SkAutoTMalloc<const SkPicture*> fPics;
- int fCount;
- };
-
- SkBigPicture(const SkRect& cull,
- SkRecord*, // We take ownership of the caller's ref.
- SnapshotArray*, // We take exclusive ownership.
- SkBBoxHierarchy*, // We take ownership of the caller's ref.
- AccelData*, // We take ownership of the caller's ref.
- size_t approxBytesUsedBySubPictures);
-
-
-// SkPicture overrides
- void playback(SkCanvas*, AbortCallback*) const override;
- SkRect cullRect() const override;
- bool hasText() const override;
- bool willPlayBackBitmaps() const override;
- int approximateOpCount() const override;
- size_t approximateBytesUsed() const override;
- bool suitableForGpuRasterization(GrContext*, const char** whyNot) const override;
- const SkBigPicture* asSkBigPicture() const override { return this; }
-
-// Used by GrLayerHoister
- void partialPlayback(SkCanvas*,
- unsigned start,
- unsigned stop,
- const SkMatrix& initialCTM) const;
-// Used by GrRecordReplaceDraw
- const SkBBoxHierarchy* bbh() const { return fBBH; }
- const SkRecord* record() const { return fRecord; }
- const AccelData* accelData() const { return fAccelData; }
-
-private:
- struct Analysis {
- explicit Analysis(const SkRecord&);
-
- bool suitableForGpuRasterization(const char** reason) const;
-
- uint8_t fNumSlowPathsAndDashEffects;
- bool fWillPlaybackBitmaps : 1;
- bool fHasText : 1;
- };
- struct PathCounter;
-
- int numSlowPaths() const override;
-
- int drawableCount() const;
- SkPicture const* const* drawablePicts() const;
-
- const SkRect fCullRect;
- const Analysis fAnalysis;
- const size_t fApproxBytesUsedBySubPictures;
- SkAutoTUnref<const SkRecord> fRecord;
- SkAutoTDelete<const SnapshotArray> fDrawablePicts;
- SkAutoTUnref<const SkBBoxHierarchy> fBBH;
- SkAutoTUnref<const AccelData> fAccelData;
-};
-
-#endif//SkBigPicture_DEFINED