aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-07-11 09:08:46 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-11 14:07:08 +0000
commitc87cfb674bcaf27062dd11f88f1337af70173a11 (patch)
treeba2d1a2e7338aaf96bcddbdcb2dd9f7b746dfa23 /src/core
parentf730c1820fbab8c29b51738f8dd19cb88c7d5136 (diff)
Remove old lazy image decoding heuristic logic
This led to removing a lot of transfer function behavior code. There is more that could be done, and we need to add in decoding to dst color space, but this CL is almost entirely mechanical. Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6 Reviewed-on: https://skia-review.googlesource.com/140349 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkImageCacherator.h6
-rw-r--r--src/core/SkImageGenerator.cpp4
-rw-r--r--src/core/SkPictureImageGenerator.cpp10
-rw-r--r--src/core/SkPictureImageGenerator.h1
4 files changed, 6 insertions, 15 deletions
diff --git a/src/core/SkImageCacherator.h b/src/core/SkImageCacherator.h
index e5ed250294..101a5faf9a 100644
--- a/src/core/SkImageCacherator.h
+++ b/src/core/SkImageCacherator.h
@@ -31,15 +31,9 @@ public:
enum CachedFormat {
kLegacy_CachedFormat, // The format from the generator, with any color space stripped out
- kLinearF16_CachedFormat, // Half float RGBA with linear gamma
- kSRGB8888_CachedFormat, // sRGB bytes
- kSBGR8888_CachedFormat, // sRGB bytes, in BGR order
-
kNumCachedFormats,
};
- virtual CachedFormat chooseCacheFormat(SkColorSpace* dstColorSpace,
- const GrCaps* = nullptr) const = 0;
virtual SkImageInfo buildCacheInfo(CachedFormat) const = 0;
#if SK_SUPPORT_GPU
diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp
index 865a718e44..1aa8873723 100644
--- a/src/core/SkImageGenerator.cpp
+++ b/src/core/SkImageGenerator.cpp
@@ -66,18 +66,16 @@ bool SkImageGenerator::getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes
sk_sp<GrTextureProxy> SkImageGenerator::generateTexture(GrContext* ctx, const SkImageInfo& info,
const SkIPoint& origin,
- SkTransferFunctionBehavior behavior,
bool willNeedMipMaps) {
SkIRect srcRect = SkIRect::MakeXYWH(origin.x(), origin.y(), info.width(), info.height());
if (!SkIRect::MakeWH(fInfo.width(), fInfo.height()).contains(srcRect)) {
return nullptr;
}
- return this->onGenerateTexture(ctx, info, origin, behavior, willNeedMipMaps);
+ return this->onGenerateTexture(ctx, info, origin, willNeedMipMaps);
}
sk_sp<GrTextureProxy> SkImageGenerator::onGenerateTexture(GrContext*, const SkImageInfo&,
const SkIPoint&,
- SkTransferFunctionBehavior,
bool willNeedMipMaps) {
return nullptr;
}
diff --git a/src/core/SkPictureImageGenerator.cpp b/src/core/SkPictureImageGenerator.cpp
index f17ff647ae..0f52dc1d7c 100644
--- a/src/core/SkPictureImageGenerator.cpp
+++ b/src/core/SkPictureImageGenerator.cpp
@@ -56,8 +56,8 @@ SkPictureImageGenerator::SkPictureImageGenerator(const SkImageInfo& info, sk_sp<
bool SkPictureImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
const Options& opts) {
- bool useXformCanvas =
- SkTransferFunctionBehavior::kIgnore == opts.fBehavior && info.colorSpace();
+ // TODO: Stop using xform canvas and simplify this code once rasterization works the same way
+ bool useXformCanvas = /* kIgnore == behavior && */ info.colorSpace();
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
SkImageInfo canvasInfo = useXformCanvas ? info.makeColorSpace(nullptr) : info;
@@ -99,10 +99,10 @@ SkImageGenerator::MakeFromPicture(const SkISize& size, sk_sp<SkPicture> picture,
#if SK_SUPPORT_GPU
sk_sp<GrTextureProxy> SkPictureImageGenerator::onGenerateTexture(
- GrContext* ctx, const SkImageInfo& info, const SkIPoint& origin,
- SkTransferFunctionBehavior behavior, bool willNeedMipMaps) {
+ GrContext* ctx, const SkImageInfo& info, const SkIPoint& origin, bool willNeedMipMaps) {
SkASSERT(ctx);
- bool useXformCanvas = SkTransferFunctionBehavior::kIgnore == behavior && info.colorSpace();
+ // TODO: Stop using xform canvas and simplify this code once rasterization works the same way
+ bool useXformCanvas = /* behavior == kIgnore && */ info.colorSpace();
//
// TODO: respect the usage, by possibly creating a different (pow2) surface
diff --git a/src/core/SkPictureImageGenerator.h b/src/core/SkPictureImageGenerator.h
index 4c5f8e3a75..8f16c19318 100644
--- a/src/core/SkPictureImageGenerator.h
+++ b/src/core/SkPictureImageGenerator.h
@@ -23,7 +23,6 @@ protected:
#if SK_SUPPORT_GPU
TexGenType onCanGenerateTexture() const override { return TexGenType::kExpensive; }
sk_sp<GrTextureProxy> onGenerateTexture(GrContext*, const SkImageInfo&, const SkIPoint&,
- SkTransferFunctionBehavior,
bool willNeedMipMaps) override;
#endif