Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Unified Diff: src/gpu/GrGpu.h

Issue 1717393002: Add "sample locations" feature to GrProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_getmultisamp
Patch Set: assert Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrGpu.h
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 147c4810200ea45daa192aa6e585fcc98f049ad8..da636138fe6bfebe94006ecc7f7e88745238dcf8 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,
@@ -487,6 +493,11 @@ protected:
}
}
+ class SamplePattern : public SkTArray<SkPoint, true> {
bsalomon 2016/02/22 20:28:25 It seems a little odd to me for this to be a point
Chris Dalton 2016/02/22 21:19:11 Yeah, that felt a little weird. The only reason th
Chris Dalton 2016/02/22 22:17:55 Done.
+ public:
+ bool operator <(const SamplePattern&) const;
+ };
+
Stats fStats;
SkAutoTDelete<GrPathRendering> fPathRendering;
// Subclass must initialize this in its constructor.
@@ -566,6 +577,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;
@@ -574,6 +591,9 @@ private:
ResetTimestamp fResetTimestamp;
uint32_t fResetBits;
+ SkTArray<skstd::unique_ptr<MultisampleSpecs> > fRasterMultisampleSpecs;
+ std::map<SamplePattern, uint16_t> fKnownSamplePatterns;
+ uint16_t fNextSamplePatternID;
// The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
GrContext* fContext;

Powered by Google App Engine
This is Rietveld 408576698