aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Lazy.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-02-14 13:52:27 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-14 19:55:24 +0000
commit95edb43251e8fcef4286c91d334c3259940a0095 (patch)
tree55798313262fc26d58486e07419f00c925b8209d /src/image/SkImage_Lazy.cpp
parent33f38b05fb54994a39ff77c1b8681276c6d03ea3 (diff)
Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them immediately.""
This reverts commit 0ee866dac78b60497b4c107995d3c2747309ef8b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "When creating emptyp MipMap proxies, don't instantiate them immediately." > > This reverts commit 8242c5c199f5d04e4209222b265f9e27f7c55fa7. > > Reason for revert: Hitting assert on intel bots on skbug6850overlay2.skp, SkASSERT(proxy->getUniqueKey().isValid()); in processInvalidProxyUniqueKey > > Original change's description: > > When creating emptyp MipMap proxies, don't instantiate them immediately. > > > > This chnages makes it match how we handle non mipped proxies where we > > don't actually instantiate them until we need to. > > > > Bug: skia: > > Change-Id: Id0c50eefce43ef1458a3ff0bb1881a817b045279 > > Reviewed-on: https://skia-review.googlesource.com/106966 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,robertphillips@google.com > > Change-Id: I1fa6165b69c5bbb1d6bb10abba33dcdb55a27ba3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/107263 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com Bug: skia: Change-Id: Ice34283f9ac183faed6e061d8162cf2226b18289 Reviewed-on: https://skia-review.googlesource.com/107320 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/image/SkImage_Lazy.cpp')
-rw-r--r--src/image/SkImage_Lazy.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index 1fc6d95094..4adf4e8368 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -701,12 +701,13 @@ static void set_key_on_proxy(GrProxyProvider* proxyProvider,
const GrUniqueKey& key) {
if (key.isValid()) {
SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin);
- if (originalProxy) {
+ if (originalProxy && originalProxy->getUniqueKey().isValid()) {
+ SkASSERT(originalProxy->getUniqueKey() == key);
SkASSERT(GrMipMapped::kYes == proxy->mipMapped() &&
GrMipMapped::kNo == originalProxy->mipMapped());
- // If we had an originalProxy, that means there already is a proxy in the cache which
- // matches the key, but it does not have mip levels and we require them. Thus we must
- // remove the unique key from that proxy.
+ // If we had an originalProxy with a valid key, that means there already is a proxy in
+ // the cache which matches the key, but it does not have mip levels and we require them.
+ // Thus we must remove the unique key from that proxy.
proxyProvider->removeUniqueKeyFromProxy(key, originalProxy);
}
proxyProvider->assignUniqueKeyToProxy(key, proxy);