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

Unified Diff: include/gpu/GrCaps.h

Issue 1717393002: Add "sample locations" feature to GrProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_getmultisamp
Patch Set: comments Created 4 years, 9 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
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698