aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-20 10:25:54 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-20 15:32:33 +0000
commit2a30390ce6130b27c18152edf75d48616adeb934 (patch)
tree0985a31a81f35df3111540319bbcb25dcf087854 /include
parent0c7861ff0c727160ab5306f531e94d40650d7466 (diff)
Update createWrappedRenderTargetProxy with BackendRT to work with lazy proxies.
This change also triggered a bunch of side changes thanks to WrappedProxyTest fixing/improving how we handle wrapped proxies in genernal. Bug: skia: Change-Id: I743a458923cff1c2e947627d0e9154a4c808a668 Reviewed-on: https://skia-review.googlesource.com/108102 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Chris Dalton <csmartdalton@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrBackendSurface.h5
-rw-r--r--include/gpu/GrCaps.h21
-rw-r--r--include/private/GrRenderTargetProxy.h3
3 files changed, 28 insertions, 1 deletions
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h
index c8072c9bfb..c2fc619d8a 100644
--- a/include/gpu/GrBackendSurface.h
+++ b/include/gpu/GrBackendSurface.h
@@ -144,6 +144,8 @@ public:
// Returns true if the backend texture has been initialized.
bool isValid() const { return fConfig != kUnknown_GrPixelConfig; }
+ GrPixelConfig testingOnly_getPixelConfig() const;
+
private:
// Friending for access to the GrPixelConfig
friend class SkImage;
@@ -218,6 +220,8 @@ public:
// Returns true if the backend texture has been initialized.
bool isValid() const { return fConfig != kUnknown_GrPixelConfig; }
+ GrPixelConfig testingOnly_getPixelConfig() const;
+
private:
// Friending for access to the GrPixelConfig
friend class SkSurface;
@@ -225,6 +229,7 @@ private:
friend class SkImage_Gpu;
friend class GrGpu;
friend class GrGLGpu;
+ friend class GrProxyProvider;
friend class GrVkGpu;
GrPixelConfig config() const { return fConfig; }
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 1b81b18fcb..9d6ef0deaf 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -58,6 +58,11 @@ public:
bool instanceAttribSupport() const { return fInstanceAttribSupport; }
bool usesMixedSamples() const { return fUsesMixedSamples; }
+ // Returns whether mixed samples is supported for the given backend render target.
+ bool isMixedSamplesSupportedForRT(const GrBackendRenderTarget& rt) const {
+ return this->usesMixedSamples() && this->onIsMixedSamplesSupportedForRT(rt);
+ }
+
// Primitive restart functionality is core in ES 3.0, but using it will cause slowdowns on some
// systems. This cap is only set if primitive restart will improve performance.
bool usePrimitiveRestart() const { return fUsePrimitiveRestart; }
@@ -137,6 +142,11 @@ public:
int maxWindowRectangles() const { return fMaxWindowRectangles; }
+ // Returns whether mixed samples is supported for the given backend render target.
+ bool isWindowRectanglesSupportedForRT(const GrBackendRenderTarget& rt) const {
+ return this->maxWindowRectangles() > 0 && this->onIsWindowRectanglesSupportedForRT(rt);
+ }
+
// A tuned, platform-specific value for the maximum number of analytic fragment processors we
// should use to implement a clip, before falling back on a mask.
int maxClipAnalyticFPs() const { return fMaxClipAnalyticFPs; }
@@ -277,6 +287,17 @@ private:
virtual void onApplyOptionsOverrides(const GrContextOptions&) {}
virtual void onDumpJSON(SkJSONWriter*) const {}
+ // Backends should implement this if they have any extra requirements for use of mixed
+ // samples for a specific GrBackendRenderTarget outside of basic support.
+ virtual bool onIsMixedSamplesSupportedForRT(const GrBackendRenderTarget&) const {
+ return true;
+ }
+ // Backends should implement this if they have any extra requirements for use of window
+ // rectangles for a specific GrBackendRenderTarget outside of basic support.
+ virtual bool onIsWindowRectanglesSupportedForRT(const GrBackendRenderTarget&) const {
+ return true;
+ }
+
bool fSuppressPrints : 1;
bool fWireframeMode : 1;
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h
index 1672fd9357..783f54e20c 100644
--- a/include/private/GrRenderTargetProxy.h
+++ b/include/private/GrRenderTargetProxy.h
@@ -78,7 +78,8 @@ protected:
// The minimal knowledge version is used for CCPR where we are generating an atlas but we do not
// know the final size until flush time.
GrRenderTargetProxy(LazyInstantiateCallback&&, LazyInstantiationType lazyType,
- const GrSurfaceDesc&, SkBackingFit, SkBudgeted, uint32_t flags);
+ const GrSurfaceDesc&, SkBackingFit, SkBudgeted, uint32_t flags,
+ GrRenderTargetFlags renderTargetFlags);
// Wrapped version
GrRenderTargetProxy(sk_sp<GrSurface>, GrSurfaceOrigin);