diff options
author | Brian Osman <brianosman@google.com> | 2017-02-09 11:22:57 -0500 |
---|---|---|
committer | Brian Osman <brianosman@google.com> | 2017-02-09 17:07:24 +0000 |
commit | 462334ebc16beb2c223e806561440b2b0f86c236 (patch) | |
tree | 7e62724fcceebc916dc9adaae15c7813f76d1103 /tools | |
parent | 49a36ba6234168ef3b591f55810c22bf0fe1c2e4 (diff) |
Fix viewer on Android
We need libandroid in all scenarios, not just vulkan.
Also, the logic for making an off-screen surface was
wrong - causing us to try and make one in legacy mode.
BUG=skia:
Change-Id: I5ef2e3e2d46de96e9824f6a12a13f6310ea04f81
Reviewed-on: https://skia-review.googlesource.com/8252
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/viewer/Viewer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp index 40486e72ac..e25fc2e977 100644 --- a/tools/viewer/Viewer.cpp +++ b/tools/viewer/Viewer.cpp @@ -459,7 +459,8 @@ void Viewer::drawSlide(SkCanvas* canvas) { // ... but if we're in F16, or the gamut isn't sRGB, we need to render offscreen sk_sp<SkSurface> offscreenSurface = nullptr; - if (kRGBA_F16_SkColorType == fColorType || fColorSpace != SkColorSpace::MakeSRGB()) { + if (kRGBA_F16_SkColorType == fColorType || + (fColorSpace && fColorSpace != SkColorSpace::MakeSRGB())) { SkImageInfo info = SkImageInfo::Make(fWindow->width(), fWindow->height(), fColorType, kPremul_SkAlphaType, fColorSpace); offscreenSurface = canvas->makeSurface(info); |