diff options
author | Robert Phillips <robertphillips@google.com> | 2018-02-01 15:49:54 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-02 18:21:59 +0000 |
commit | 7a9263906c677c0fa5636521e3cc58ba60837720 (patch) | |
tree | 0eba3834734ec9415fcd703fb40c805003f2989a /src/effects | |
parent | 68c5632d9216c2318aafadc91035a25cb94ca63a (diff) |
Disable texture strip atlasing for DDL
Ultimately we will want to perform inline and ASAP uploads for the
texture strip atlas. Unfortunately, that functionality relies on the
existance of the flushState (which we don't have for the opList-based
DDL implementation). For now we will punt and try storing the individual
texture strips in their own image-based texture proxy for DDLs.
Change-Id: Ic2ee0deb230172bda4a5d4b69cc802dbe84ad7ac
Reviewed-on: https://skia-review.googlesource.com/102464
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkTableColorFilter.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index d808c6fb12..45c70d6215 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -444,17 +444,24 @@ std::unique_ptr<GrFragmentProcessor> ColorTableEffect::Make(GrContext* context, desc.fWidth = bitmap.width(); desc.fHeight = 128; desc.fRowHeight = bitmap.height(); - // TODO: this seems a bit heavy handed (passing a GrContext as part of the desc) desc.fContext = context; desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info(), *context->caps()); + GrTextureStripAtlas* atlas = GrTextureStripAtlas::GetAtlas(desc); int row = atlas->lockRow(bitmap); sk_sp<GrTextureProxy> proxy; if (-1 == row) { atlas = nullptr; - proxy = GrMakeCachedBitmapProxy(context->contextPriv().proxyProvider(), bitmap); + SkASSERT(bitmap.isImmutable()); + + sk_sp<SkImage> srcImage = SkImage::MakeFromBitmap(bitmap); + if (!srcImage) { + return nullptr; + } + + proxy = GrMakeCachedImageProxy(context->contextPriv().proxyProvider(), std::move(srcImage)); } else { proxy = atlas->asTextureProxyRef(); } |