aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp1
-rw-r--r--src/gpu/GrContext.cpp7
-rw-r--r--src/gpu/GrGpu.cpp1
-rw-r--r--src/gpu/GrPipeline.cpp1
-rw-r--r--src/gpu/GrResourceProvider.cpp5
-rw-r--r--src/gpu/GrSurfaceProxy.cpp4
-rw-r--r--src/gpu/GrTexture.cpp2
-rw-r--r--src/gpu/gl/GrGLGpu.h2
-rw-r--r--src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp12
-rw-r--r--src/image/SkImage_Gpu.cpp1
10 files changed, 7 insertions, 29 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 22cdec395a..712ebb8bb1 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -148,7 +148,6 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
}
}
- SkASSERT(kDefault_GrSurfaceOrigin != fSurfaceOrigin);
// We just gained access to the texture. If we're on the original context, we could use the
// original texture, but we'd have no way of detecting that it's no longer in-use. So we
// always make a wrapped copy, where the release proc informs us that the context is done
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 907f82c51b..decb0edd6f 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -759,7 +759,6 @@ sk_sp<GrTextureContext> GrContextPriv::makeBackendTextureContext(const GrBackend
sk_sp<SkColorSpace> colorSpace) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrSurface> surface(fContext->resourceProvider()->wrapBackendTexture(tex));
if (!surface) {
return nullptr;
@@ -781,8 +780,6 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendTextureRenderTargetContex
const SkSurfaceProps* props) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
-
sk_sp<GrSurface> surface(
fContext->resourceProvider()->wrapRenderableBackendTexture(tex, sampleCnt));
if (!surface) {
@@ -805,7 +802,6 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendRenderTargetRenderTargetC
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrRenderTarget> rt(fContext->resourceProvider()->wrapBackendRenderTarget(backendRT));
if (!rt) {
return nullptr;
@@ -829,7 +825,6 @@ sk_sp<GrRenderTargetContext> GrContextPriv::makeBackendTextureAsRenderTargetRend
const SkSurfaceProps* surfaceProps) {
ASSERT_SINGLE_OWNER_PRIV
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrSurface> surface(fContext->resourceProvider()->wrapBackendTextureAsRenderTarget(
tex,
sampleCnt));
@@ -894,8 +889,6 @@ sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContext(
GrSurfaceOrigin origin,
const SkSurfaceProps* surfaceProps,
SkBudgeted budgeted) {
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
-
if (this->abandoned()) {
return nullptr;
}
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index f99dce4e97..f42e5383b4 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -138,7 +138,6 @@ sk_sp<GrTexture> GrGpu::createTexture(const GrSurfaceDesc& origDesc, SkBudgeted
desc.fSampleCnt = caps->getSampleCount(desc.fSampleCnt, desc.fConfig);
// Attempt to catch un- or wrongly initialized sample counts.
SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);
- SkASSERT(kDefault_GrSurfaceOrigin != desc.fOrigin);
if (mipLevelCount && (desc.fFlags & kPerformInitialClear_GrSurfaceFlag)) {
return nullptr;
diff --git a/src/gpu/GrPipeline.cpp b/src/gpu/GrPipeline.cpp
index 52cb709522..d07dd08624 100644
--- a/src/gpu/GrPipeline.cpp
+++ b/src/gpu/GrPipeline.cpp
@@ -20,7 +20,6 @@
GrPipeline::GrPipeline(const InitArgs& args, GrProcessorSet&& processors,
GrAppliedClip&& appliedClip) {
SkASSERT(args.fProxy);
- SkASSERT(kDefault_GrSurfaceOrigin != args.fProxy->origin());
SkASSERT(processors.isFinalized());
fProxy.reset(args.fProxy);
diff --git a/src/gpu/GrResourceProvider.cpp b/src/gpu/GrResourceProvider.cpp
index 9f3c8cd2da..4f5f503c8c 100644
--- a/src/gpu/GrResourceProvider.cpp
+++ b/src/gpu/GrResourceProvider.cpp
@@ -98,8 +98,6 @@ sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, Sk
sk_sp<GrTexture> GrResourceProvider::getExactScratch(const GrSurfaceDesc& desc,
SkBudgeted budgeted, uint32_t flags) {
- SkASSERT(desc.fOrigin != kDefault_GrSurfaceOrigin);
-
flags |= kExact_Flag | kNoCreate_Flag;
sk_sp<GrTexture> tex(this->refScratchTexture(desc, flags));
if (tex && SkBudgeted::kNo == budgeted) {
@@ -161,7 +159,6 @@ sk_sp<GrTextureProxy> GrResourceProvider::createTextureProxy(const GrSurfaceDesc
sk_sp<GrTexture> GrResourceProvider::createTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
uint32_t flags) {
ASSERT_SINGLE_OWNER
- SkASSERT(desc.fOrigin != kDefault_GrSurfaceOrigin);
if (this->isAbandoned()) {
return nullptr;
@@ -183,7 +180,6 @@ sk_sp<GrTexture> GrResourceProvider::createApproxTexture(const GrSurfaceDesc& de
uint32_t flags) {
ASSERT_SINGLE_OWNER
SkASSERT(0 == flags || kNoPendingIO_Flag == flags);
- SkASSERT(kDefault_GrSurfaceOrigin != desc.fOrigin);
if (this->isAbandoned()) {
return nullptr;
@@ -201,7 +197,6 @@ sk_sp<GrTexture> GrResourceProvider::refScratchTexture(const GrSurfaceDesc& inDe
ASSERT_SINGLE_OWNER
SkASSERT(!this->isAbandoned());
SkASSERT(validate_desc(inDesc, *fCaps));
- SkASSERT(inDesc.fOrigin != kDefault_GrSurfaceOrigin);
SkTCopyOnFirstWrite<GrSurfaceDesc> desc(inDesc);
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 739fa6c481..5918830bf8 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -33,7 +33,6 @@ GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, GrSurfaceOrigin origin,
, fNeedsClear(false)
, fGpuMemorySize(kInvalidGpuMemorySize)
, fLastOpList(nullptr) {
- SkASSERT(kDefault_GrSurfaceOrigin != fOrigin);
}
GrSurfaceProxy::~GrSurfaceProxy() {
@@ -64,7 +63,6 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl(
int sampleCnt, bool needsStencil,
GrSurfaceFlags flags, bool isMipMapped,
SkDestinationSurfaceColorMode mipColorMode) const {
- SkASSERT(kDefault_GrSurfaceOrigin != fOrigin);
GrSurfaceDesc desc;
desc.fFlags = flags;
@@ -207,7 +205,6 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferred(GrResourceProvider* resourceP
SkBudgeted budgeted,
uint32_t flags) {
SkASSERT(0 == flags || GrResourceProvider::kNoPendingIO_Flag == flags);
- SkASSERT(kDefault_GrSurfaceOrigin != desc.fOrigin);
const GrCaps* caps = resourceProvider->caps();
@@ -302,7 +299,6 @@ sk_sp<GrTextureProxy> GrSurfaceProxy::MakeDeferredMipMap(
sk_sp<GrTextureProxy> GrSurfaceProxy::MakeWrappedBackend(GrContext* context,
GrBackendTexture& backendTex,
GrSurfaceOrigin origin) {
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrTexture> tex(context->resourceProvider()->wrapBackendTexture(backendTex));
return GrSurfaceProxy::MakeWrapped(std::move(tex), origin);
}
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 8e79a699fc..63e00a2def 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -88,8 +88,6 @@ void GrTexturePriv::ComputeScratchKey(GrPixelConfig config, int width, int heigh
}
void GrTexturePriv::ComputeScratchKey(const GrSurfaceDesc& desc, GrScratchKey* key) {
- SkASSERT(kDefault_GrSurfaceOrigin != desc.fOrigin);
-
// Note: the fOrigin field is not used in the scratch key
return ComputeScratchKey(desc.fConfig, desc.fWidth, desc.fHeight,
SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag), desc.fSampleCnt,
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 6f2e5d30c5..ba9afbca26 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -450,7 +450,7 @@ private:
void invalidate() { fRTOrigin = kInvalidSurfaceOrigin; }
bool knownDisabled() const { return this->valid() && !fWindowState.enabled(); }
void setDisabled() {
- fRTOrigin = kDefault_GrSurfaceOrigin;
+ fRTOrigin = kTopLeft_GrSurfaceOrigin;
fWindowState.setDisabled();
}
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index afbfa09a62..7e6b8f771c 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -72,10 +72,10 @@ static const char* specific_layout_qualifier_name(GrBlendEquation equation) {
uint8_t GrGLSLFragmentShaderBuilder::KeyForSurfaceOrigin(GrSurfaceOrigin origin) {
SkASSERT(kTopLeft_GrSurfaceOrigin == origin || kBottomLeft_GrSurfaceOrigin == origin);
- return origin;
+ return origin + 1;
- GR_STATIC_ASSERT(1 == kTopLeft_GrSurfaceOrigin);
- GR_STATIC_ASSERT(2 == kBottomLeft_GrSurfaceOrigin);
+ GR_STATIC_ASSERT(0 == kTopLeft_GrSurfaceOrigin);
+ GR_STATIC_ASSERT(1 == kBottomLeft_GrSurfaceOrigin);
}
GrGLSLFragmentShaderBuilder::GrGLSLFragmentShaderBuilder(GrGLSLProgramBuilder* program)
@@ -272,10 +272,10 @@ const char* GrGLSLFragmentShaderBuilder::getSecondaryColorOutputName() const {
GrSurfaceOrigin GrGLSLFragmentShaderBuilder::getSurfaceOrigin() const {
SkASSERT(fProgramBuilder->header().fSurfaceOriginKey);
- return static_cast<GrSurfaceOrigin>(fProgramBuilder->header().fSurfaceOriginKey);
+ return static_cast<GrSurfaceOrigin>(fProgramBuilder->header().fSurfaceOriginKey-1);
- GR_STATIC_ASSERT(1 == kTopLeft_GrSurfaceOrigin);
- GR_STATIC_ASSERT(2 == kBottomLeft_GrSurfaceOrigin);
+ GR_STATIC_ASSERT(0 == kTopLeft_GrSurfaceOrigin);
+ GR_STATIC_ASSERT(1 == kBottomLeft_GrSurfaceOrigin);
}
void GrGLSLFragmentShaderBuilder::onFinalize() {
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 8c2dfa0cec..d5dc4a2e32 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -266,7 +266,6 @@ static sk_sp<SkImage> new_wrapped_texture_common(GrContext* ctx,
return nullptr;
}
- SkASSERT(kDefault_GrSurfaceOrigin != origin);
sk_sp<GrTexture> tex = ctx->resourceProvider()->wrapBackendTexture(backendTex, ownership);
if (!tex) {
return nullptr;