diff options
author | 2015-05-07 17:30:13 -0700 | |
---|---|---|
committer | 2015-05-07 17:30:13 -0700 | |
commit | b7ed856fadae52401d3bbcac22cfc3391780ace8 (patch) | |
tree | dfea1030ca7eb63ea58f1e733cf741c89273d4df /src/core/SkRecordDraw.cpp | |
parent | 8b26b99c97473f020df4b9d4ba789e074e06cedd (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/SkRecordDraw.cpp')
-rw-r--r-- | src/core/SkRecordDraw.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 65e6d490db..ba15c1b512 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -587,7 +587,7 @@ private: class CollectLayers : SkNoncopyable { public: CollectLayers(const SkRect& cullRect, const SkRecord& record, - const SkBigPicture::SnapshotArray* pictList, SkLayerInfo* accelData) + const SkPicture::SnapshotArray* pictList, SkLayerInfo* accelData) : fSaveLayersInStack(0) , fAccelData(accelData) , fPictList(pictList) @@ -640,10 +640,10 @@ private: void trackSaveLayersForPicture(const SkPicture* picture, const SkPaint* paint) { // For sub-pictures, we wrap their layer information within the parent // picture's rendering hierarchy - const SkLayerInfo* childData = NULL; - if (const SkBigPicture* bp = picture->asSkBigPicture()) { - childData = static_cast<const SkLayerInfo*>(bp->accelData()); - } + SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); + + const SkLayerInfo* childData = + static_cast<const SkLayerInfo*>(picture->EXPERIMENTAL_getAccelData(key)); if (!childData) { // If the child layer hasn't been generated with saveLayer data we // assume the worst (i.e., that it does contain layers which nest @@ -774,7 +774,7 @@ private: // The op code indices of all the currently active saveLayers SkTDArray<unsigned> fSaveLayerOpStack; SkLayerInfo* fAccelData; - const SkBigPicture::SnapshotArray* fPictList; + const SkPicture::SnapshotArray* fPictList; SkRecords::FillBounds fFillBounds; }; @@ -793,7 +793,7 @@ void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkBBoxHi } void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, - const SkBigPicture::SnapshotArray* pictList, SkBBoxHierarchy* bbh, + const SkPicture::SnapshotArray* pictList, SkBBoxHierarchy* bbh, SkLayerInfo* data) { SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |