aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-13 08:11:36 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-13 13:12:17 +0000
commitc4f0a8245ccf0d14f6a6dffc73ff56b563012b69 (patch)
treea595e5acd034b2d708122dea9a4d046610537c02 /src/gpu
parente8f28818a2c0fe967f9fc4cec4bb9dc78af78212 (diff)
Move Flags from GrRenderTarget to GrTypesPriv.h & rename
The motivation for this is to prevent GrRenderTarget.h appearing in GrRenderTargetProxy.h Change-Id: I4ef126972c0780cbacb35fa2aa6290777c66eddf Reviewed-on: https://skia-review.googlesource.com/19521 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrRenderTarget.cpp8
-rw-r--r--src/gpu/GrRenderTargetPriv.h4
-rw-r--r--src/gpu/GrRenderTargetProxy.cpp15
-rw-r--r--src/gpu/GrSurface.cpp1
-rw-r--r--src/gpu/GrTextureRenderTargetProxy.cpp4
-rw-r--r--src/gpu/gl/GrGLRenderTarget.cpp10
-rw-r--r--src/gpu/gl/GrGLRenderTarget.h2
7 files changed, 23 insertions, 21 deletions
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 8b1fde6b46..ae63c23442 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -17,7 +17,8 @@
#include "GrStencilAttachment.h"
#include "GrStencilSettings.h"
-GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, Flags flags,
+GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc,
+ GrRenderTargetFlags flags,
GrStencilAttachment* stencil)
: INHERITED(gpu, desc)
, fSampleCnt(desc.fSampleCnt)
@@ -25,8 +26,9 @@ GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, Flags flag
, fMultisampleSpecsID(0)
, fFlags(flags) {
SkASSERT(desc.fFlags & kRenderTarget_GrSurfaceFlag);
- SkASSERT(!(fFlags & Flags::kMixedSampled) || fSampleCnt > 0);
- SkASSERT(!(fFlags & Flags::kWindowRectsSupport) || gpu->caps()->maxWindowRectangles() > 0);
+ SkASSERT(!(fFlags & GrRenderTargetFlags::kMixedSampled) || fSampleCnt > 0);
+ SkASSERT(!(fFlags & GrRenderTargetFlags::kWindowRectsSupport) ||
+ gpu->caps()->maxWindowRectangles() > 0);
fResolveRect.setLargestInverted();
}
diff --git a/src/gpu/GrRenderTargetPriv.h b/src/gpu/GrRenderTargetPriv.h
index 89f4d5289e..271dd44dd7 100644
--- a/src/gpu/GrRenderTargetPriv.h
+++ b/src/gpu/GrRenderTargetPriv.h
@@ -37,9 +37,7 @@ public:
// to affect the multisample information itself.
const GrGpu::MultisampleSpecs& getMultisampleSpecs(const GrPipeline&) const;
- typedef GrRenderTarget::Flags Flags;
-
- Flags flags() const { return fRenderTarget->fFlags; }
+ GrRenderTargetFlags flags() const { return fRenderTarget->fFlags; }
private:
explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(renderTarget) {}
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index b582455809..79d083d955 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -22,25 +22,26 @@ GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrSurfaceDesc
SkBackingFit fit, SkBudgeted budgeted, uint32_t flags)
: INHERITED(desc, fit, budgeted, flags)
, fSampleCnt(desc.fSampleCnt)
- , fRenderTargetFlags(GrRenderTarget::Flags::kNone) {
+ , fRenderTargetFlags(GrRenderTargetFlags::kNone) {
// Since we know the newly created render target will be internal, we are able to precompute
// what the flags will ultimately end up being.
if (caps.usesMixedSamples() && fSampleCnt > 0) {
- fRenderTargetFlags |= GrRenderTarget::Flags::kMixedSampled;
+ fRenderTargetFlags |= GrRenderTargetFlags::kMixedSampled;
}
if (caps.maxWindowRectangles() > 0) {
- fRenderTargetFlags |= GrRenderTarget::Flags::kWindowRectsSupport;
+ fRenderTargetFlags |= GrRenderTargetFlags::kWindowRectsSupport;
}
}
// Wrapped version
GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf)
- : INHERITED(std::move(surf), SkBackingFit::kExact)
- , fSampleCnt(fTarget->asRenderTarget()->numStencilSamples())
- , fRenderTargetFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) {}
+ : INHERITED(std::move(surf), SkBackingFit::kExact)
+ , fSampleCnt(fTarget->asRenderTarget()->numStencilSamples())
+ , fRenderTargetFlags(fTarget->asRenderTarget()->renderTargetPriv().flags()) {
+}
int GrRenderTargetProxy::maxWindowRectangles(const GrCaps& caps) const {
- return (fRenderTargetFlags & GrRenderTarget::Flags::kWindowRectsSupport)
+ return (fRenderTargetFlags & GrRenderTargetFlags::kWindowRectsSupport)
? caps.maxWindowRectangles()
: 0;
}
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 635e74e49c..b97980f50c 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -8,6 +8,7 @@
#include "GrSurface.h"
#include "GrContext.h"
#include "GrOpList.h"
+#include "GrRenderTarget.h"
#include "GrSurfacePriv.h"
#include "GrTexture.h"
diff --git a/src/gpu/GrTextureRenderTargetProxy.cpp b/src/gpu/GrTextureRenderTargetProxy.cpp
index 97c990dabe..9c4ccc67c2 100644
--- a/src/gpu/GrTextureRenderTargetProxy.cpp
+++ b/src/gpu/GrTextureRenderTargetProxy.cpp
@@ -17,7 +17,7 @@ GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(const GrCaps& caps,
uint32_t flags)
: GrSurfaceProxy(desc, fit, budgeted, flags)
// for now textures w/ data are always wrapped
- , GrTextureProxy(desc, fit, budgeted, nullptr, 0, flags)
+ , GrTextureProxy(desc, fit, budgeted, nullptr, 0, flags)
, GrRenderTargetProxy(caps, desc, fit, budgeted, flags) {
}
@@ -27,7 +27,7 @@ GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(const GrCaps& caps,
GrTextureRenderTargetProxy::GrTextureRenderTargetProxy(sk_sp<GrSurface> surf)
: GrSurfaceProxy(surf, SkBackingFit::kExact)
, GrTextureProxy(surf)
- , GrRenderTargetProxy(sk_ref_sp(surf->asRenderTarget())) {
+ , GrRenderTargetProxy(surf) {
SkASSERT(surf->asTexture());
SkASSERT(surf->asRenderTarget());
}
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 00a78408d2..23005dc6c9 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -36,15 +36,15 @@ GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, const GrSurfaceDesc& desc,
this->init(desc, idDesc);
}
-inline GrRenderTarget::Flags GrGLRenderTarget::ComputeFlags(const GrGLCaps& glCaps,
- const IDDesc& idDesc) {
- Flags flags = Flags::kNone;
+inline GrRenderTargetFlags GrGLRenderTarget::ComputeFlags(const GrGLCaps& glCaps,
+ const IDDesc& idDesc) {
+ GrRenderTargetFlags flags = GrRenderTargetFlags::kNone;
if (idDesc.fIsMixedSampled) {
SkASSERT(glCaps.usesMixedSamples() && idDesc.fRTFBOID); // FBO 0 can't be mixed sampled.
- flags |= Flags::kMixedSampled;
+ flags |= GrRenderTargetFlags::kMixedSampled;
}
if (glCaps.maxWindowRectangles() > 0 && idDesc.fRTFBOID) {
- flags |= Flags::kWindowRectsSupport;
+ flags |= GrRenderTargetFlags::kWindowRectsSupport;
}
return flags;
}
diff --git a/src/gpu/gl/GrGLRenderTarget.h b/src/gpu/gl/GrGLRenderTarget.h
index 795b41e75d..124ae9293b 100644
--- a/src/gpu/gl/GrGLRenderTarget.h
+++ b/src/gpu/gl/GrGLRenderTarget.h
@@ -81,7 +81,7 @@ private:
// Constructor for instances wrapping backend objects.
GrGLRenderTarget(GrGLGpu*, const GrSurfaceDesc&, const IDDesc&, GrGLStencilAttachment*);
- static Flags ComputeFlags(const GrGLCaps&, const IDDesc&);
+ static GrRenderTargetFlags ComputeFlags(const GrGLCaps&, const IDDesc&);
GrGLGpu* getGLGpu() const;
bool completeStencilAttachment() override;