diff options
author | Robert Phillips <robertphillips@google.com> | 2018-01-30 13:13:42 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-30 13:13:56 +0000 |
commit | 7f861927fcd4f9fdef958b5ed9d50b1362ee3232 (patch) | |
tree | f7c60f611d039539676ae4eb2466d81798e81cd7 /src/gpu/GrGpu.h | |
parent | 2f5b8d81c231ef4acb4b5671c0956a249f0ef4cf (diff) |
Revert "Drop support for unused MSAA extensions"
This reverts commit 7df27465c4ecc8a4a0cdd95e9785c342903c2de9.
Reason for revert: experimental revert to see if this is the cause of the tree redness
Original change's description:
> Drop support for unused MSAA extensions
>
> Bug: skia:
> Change-Id: I113b80e3f991f195155148625ceb29242ea82776
> Reviewed-on: https://skia-review.googlesource.com/101403
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com
Change-Id: I4fa4123e2d176bef88cd76a09a14053d9ac5809f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/101680
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r-- | src/gpu/GrGpu.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index d03c0811c9..2f12073f8a 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -328,6 +328,33 @@ public: const SkIRect& srcRect, const SkIPoint& dstPoint); + struct MultisampleSpecs { + MultisampleSpecs(uint8_t uniqueID, int effectiveSampleCnt, const SkPoint* locations) + : fUniqueID(uniqueID), + fEffectiveSampleCnt(effectiveSampleCnt), + fSampleLocations(locations) {} + + // Nonzero ID that uniquely identifies these multisample specs. + uint8_t fUniqueID; + // The actual number of samples the GPU will run. NOTE: this value can be greater than the + // the render target's sample count. + int fEffectiveSampleCnt; + // If sample locations are supported, points to the subpixel locations at which the GPU will + // sample. Pixel center is at (.5, .5), and (0, 0) indicates the top left corner. + const SkPoint* fSampleLocations; + }; + + // Finds a render target's multisample specs. The pipeline is only needed in case we need to + // flush the draw state prior to querying multisample info. The pipeline is not expected to + // affect the multisample information itself. + const MultisampleSpecs& queryMultisampleSpecs(const GrPipeline&); + + // Finds the multisample specs with a given unique id. + const MultisampleSpecs& getMultisampleSpecs(uint8_t uniqueID) { + SkASSERT(uniqueID > 0 && uniqueID < fMultisampleSpecs.count()); + return fMultisampleSpecs[uniqueID]; + } + // Creates a GrGpuRTCommandBuffer which GrOpLists send draw commands to instead of directly // to the Gpu object. virtual GrGpuRTCommandBuffer* createCommandBuffer( @@ -572,6 +599,11 @@ private: GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, const SkIPoint& dstPoint) = 0; + // overridden by backend specific derived class to perform the multisample queries + virtual void onQueryMultisampleSpecs(GrRenderTarget*, GrSurfaceOrigin rtOrigin, + const GrStencilSettings&, + int* effectiveSampleCnt, SamplePattern*) = 0; + virtual void onFinishFlush(bool insertedSemaphores) = 0; virtual void onDumpJSON(SkJSONWriter*) const {} @@ -586,8 +618,12 @@ private: bool operator()(const SamplePattern&, const SamplePattern&) const; }; + typedef std::map<SamplePattern, uint8_t, SamplePatternComparator> MultisampleSpecsIdMap; + ResetTimestamp fResetTimestamp; uint32_t fResetBits; + MultisampleSpecsIdMap fMultisampleSpecsIdMap; + SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. GrContext* fContext; |