aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-07-24 14:47:57 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-24 19:37:46 +0000
commit019ff27ac0167026f9f8f4aaec8fb6461d8ba21e (patch)
treedcdae9d90a580ec620bcc2726439811557ac6f1e /src/gpu
parent6de39c1e014afec8094e8c2cd4422b72c2d8e5ea (diff)
Third small fragment from "Reduce dependence on GrSurface's origin field"
TBR=bsalomon@google.com Change-Id: Ifae30beb333e9d668fa1378e332e8a4d063a371e Reviewed-on: https://skia-review.googlesource.com/26348 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBitmapTextureMaker.cpp1
-rw-r--r--src/gpu/GrClipStackClip.cpp2
-rw-r--r--src/gpu/GrSurfaceProxy.cpp4
-rw-r--r--src/gpu/SkGr.cpp2
4 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/GrBitmapTextureMaker.cpp b/src/gpu/GrBitmapTextureMaker.cpp
index 762b72c811..6fb2c6a3a8 100644
--- a/src/gpu/GrBitmapTextureMaker.cpp
+++ b/src/gpu/GrBitmapTextureMaker.cpp
@@ -50,6 +50,7 @@ sk_sp<GrTextureProxy> GrBitmapTextureMaker::refOriginalTextureProxy(bool willBeM
dstColorSpace);
}
if (proxy && fOriginalKey.isValid()) {
+ SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
this->context()->resourceProvider()->assignUniqueKeyToProxy(fOriginalKey, proxy.get());
// MDB TODO (caching): this has to play nice with the GrSurfaceProxy's caching
GrInstallBitmapUniqueKeyInvalidator(fOriginalKey, fBitmap.pixelRef());
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 9a93687e50..3a31d0baf7 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -418,6 +418,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createAlphaClipMask(GrContext* context,
return nullptr;
}
+ SkASSERT(result->origin() == kBottomLeft_GrSurfaceOrigin);
resourceProvider->assignUniqueKeyToProxy(key, result.get());
// MDB TODO (caching): this has to play nice with the GrSurfaceProxy's caching
add_invalidate_on_pop_message(*fStack, reducedClip.elementsGenID(), key);
@@ -489,6 +490,7 @@ sk_sp<GrTextureProxy> GrClipStackClip::createSoftwareClipMask(
sk_sp<GrTextureProxy> result(helper.toTextureProxy(context, SkBackingFit::kApprox));
+ SkASSERT(result->origin() == kTopLeft_GrSurfaceOrigin);
context->resourceProvider()->assignUniqueKeyToProxy(key, result.get());
// MDB TODO (caching): this has to play nice with the GrSurfaceProxy's caching
add_invalidate_on_pop_message(*fStack, reducedClip.elementsGenID(), key);
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index 7efb139eda..b4e4685918 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -32,7 +32,9 @@ GrSurfaceProxy::GrSurfaceProxy(sk_sp<GrSurface> surface, SkBackingFit fit)
, fUniqueID(fTarget->uniqueID()) // Note: converting from unique resource ID to a proxy ID!
, fNeedsClear(false)
, fGpuMemorySize(kInvalidGpuMemorySize)
- , fLastOpList(nullptr) {}
+ , fLastOpList(nullptr) {
+ SkASSERT(kDefault_GrSurfaceOrigin != fOrigin);
+}
GrSurfaceProxy::~GrSurfaceProxy() {
// For this to be deleted the opList that held a ref on it (if there was one) must have been
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index af0a55a156..80ea1ca522 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -42,6 +42,7 @@
GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo& info, const GrCaps& caps) {
GrSurfaceDesc desc;
desc.fFlags = kNone_GrSurfaceFlags;
+ desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fWidth = info.width();
desc.fHeight = info.height();
desc.fConfig = SkImageInfo2GrPixelConfig(info, caps);
@@ -253,6 +254,7 @@ sk_sp<GrTextureProxy> GrMakeCachedBitmapProxy(GrResourceProvider* resourceProvid
// we can't necessarily know the |dstColorSpace| at this time.
proxy = GrUploadBitmapToTextureProxy(resourceProvider, bitmap, nullptr);
if (proxy && originalKey.isValid()) {
+ SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
resourceProvider->assignUniqueKeyToProxy(originalKey, proxy.get());
// MDB TODO (caching): this has to play nice with the GrSurfaceProxy's caching
GrInstallBitmapUniqueKeyInvalidator(originalKey, bitmap.pixelRef());