Index: src/gpu/GrGpu.h |
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h |
index 5d35fcf859bca3792681e9e6ff5037e92fc9fdf0..ce90b1d3b9296e14216483ca49f1bb66982c9f2d 100644 |
--- a/src/gpu/GrGpu.h |
+++ b/src/gpu/GrGpu.h |
@@ -10,6 +10,7 @@ |
#include "GrPipelineBuilder.h" |
#include "GrProgramDesc.h" |
+#include "GrRenderTargetPriv.h" |
#include "GrStencil.h" |
#include "GrSwizzle.h" |
#include "GrTextureParamsAdjuster.h" |
@@ -17,6 +18,7 @@ |
#include "GrXferProcessor.h" |
#include "SkPath.h" |
#include "SkTArray.h" |
+#include <map> |
class GrBatchTracker; |
class GrContext; |
@@ -365,6 +367,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, |
@@ -524,6 +530,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. |
@@ -601,6 +609,12 @@ 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; |
@@ -612,6 +626,14 @@ private: |
// The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
GrContext* fContext; |
+ struct SamplePatternComparator { |
+ bool operator()(const SamplePattern&, const SamplePattern&) const; |
+ }; |
+ |
+ std::map<SamplePattern, uint16_t, SamplePatternComparator> fKnownSamplePatterns; |
+ uint16_t fNextSamplePatternID; |
+ SkTArray<skstd::unique_ptr<MultisampleSpecs> > fRasterMultisampleSpecs; |
+ |
friend class GrPathRendering; |
typedef SkRefCnt INHERITED; |
}; |