Index: src/gpu/GrGpu.h |
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
index 147c4810200ea45daa192aa6e585fcc98f049ad8..49b555d0905ebe8d97a6c9ddde061f2d80a3ec11 100644 |
--- a/src/gpu/GrGpu.h |
+++ b/src/gpu/GrGpu.h |
@@ -10,11 +10,13 @@ |
#include "GrPipelineBuilder.h" |
#include "GrProgramDesc.h" |
+#include "GrRenderTargetPriv.h" |
#include "GrStencil.h" |
#include "GrSwizzle.h" |
#include "GrTextureParamsAdjuster.h" |
#include "GrXferProcessor.h" |
#include "SkPath.h" |
+#include <map> |
class GrBatchTracker; |
class GrContext; |
@@ -333,6 +335,10 @@ public: |
const SkIRect& srcRect, |
const SkIPoint& dstPoint); |
+ typedef GrRenderTargetPriv::MultisampleSpecs MultisampleSpecs; |
+ |
+ const MultisampleSpecs& getMultisampleSpecs(GrRenderTarget*, const GrStencilSettings&); |
+ |
struct DrawArgs { |
DrawArgs(const GrPrimitiveProcessor* primProc, |
const GrPipeline* pipeline, |
@@ -492,6 +498,8 @@ protected: |
// Subclass must initialize this in its constructor. |
SkAutoTUnref<const GrCaps> fCaps; |
+ typedef SkTArray<SkPoint, true> SamplePattern; |
+ |
private: |
// called when the 3D context state is unknown. Subclass should emit any |
// assumed 3D context state and dirty any state cache. |
@@ -566,14 +574,27 @@ private: |
const SkIRect& srcRect, |
const SkIPoint& dstPoint) = 0; |
+ // overridden by backend specific derived class to perform the multisample queries |
+ virtual void onGetMultisampleSpecs(GrRenderTarget*, |
+ const GrStencilSettings&, |
+ int* effectiveSampleCnt, |
+ SamplePattern*) = 0; |
+ |
void resetContext() { |
this->onResetContext(fResetBits); |
fResetBits = 0; |
++fResetTimestamp; |
} |
+ struct SamplePatternComparator { |
+ bool operator()(const SamplePattern&, const SamplePattern&) const; |
+ }; |
+ |
ResetTimestamp fResetTimestamp; |
uint32_t fResetBits; |
+ SkTArray<skstd::unique_ptr<MultisampleSpecs> > fRasterMultisampleSpecs; |
+ std::map<SamplePattern, uint16_t, SamplePatternComparator> fKnownSamplePatterns; |
+ uint16_t fNextSamplePatternID; |
// The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
GrContext* fContext; |