Chromium Code Reviews| Index: include/gpu/GrCaps.h |
| diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h |
| index 60f213950ebf1b843bc5d5fc48290a2f6d758e8a..2525d113e4d0c5e54cd1a843cd1a67be680584fa 100644 |
| --- a/include/gpu/GrCaps.h |
| +++ b/include/gpu/GrCaps.h |
| @@ -14,6 +14,8 @@ |
| #include "GrShaderVar.h" |
| #include "SkRefCnt.h" |
| #include "SkString.h" |
| +#include "../../src/gpu/GrAllocator.h" |
| +#include <functional> |
| struct GrContextOptions; |
| @@ -258,6 +260,29 @@ public: |
| is not initialized (even if not read by draw calls). */ |
| bool mustClearUploadedBufferData() const { return fMustClearUploadedBufferData; } |
| + /** Info struct that contains hardware-specific multisample info. */ |
| + struct MultisampleSpecs { |
| + /** 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, contains the subpixel locations at which the GPU will |
| + sample. Pixel center is at (.5, .5) and (0, 0) indicates the top left corner. */ |
| + SkAutoTDeleteArray<const SkPoint> fSampleLocations; |
| + }; |
| + |
| + typedef std::function<void(int* effectiveSampleCnt, SkAutoTDeleteArray<SkPoint>* locations)> |
| + QueryMultisampleFunctor; |
| + |
| + /** Finds a surface descriptor's multisample specs. */ |
| + const MultisampleSpecs& getMultisampleSpecs(const GrSurfaceDesc&, |
|
bsalomon
2016/03/07 19:10:06
I'm curious why this has to be on GrCaps (as oppos
Chris Dalton
2016/03/07 19:36:44
There's nothing platform specific about caching sa
|
| + const QueryMultisampleFunctor&) const; |
| + |
| + /** Retrieves existing multisample specs. The provided uniqueID must have come from a valid |
| + MultisampleSpecs instance that was returned previously by this class. */ |
| + const MultisampleSpecs& getMultisampleSpecs(const uint8_t uniqueID) const; |
| + |
| protected: |
| /** Subclasses must call this at the end of their constructors in order to apply caps |
| overrides requested by the client. Note that overrides will only reduce the caps never |
| @@ -312,6 +337,9 @@ private: |
| bool fImmediateFlush: 1; |
| bool fDrawPathMasksToCompressedTextureSupport : 1; |
| + mutable SkTArray<const MultisampleSpecs*, true> fMultisampleSpecsMap; |
| + mutable GrTAllocator<MultisampleSpecs> fMultisampleSpecsAllocator; |
| + |
| typedef SkRefCnt INHERITED; |
| }; |