Plumb dst color space in many places, rather than "mode"
This is less to type in most cases, and gives us more information
(for things like picture-backed images, where we need to know all
about the destination surface).
Additionally, strip out the plumbing entirely for bitmap sources,
where we don't need to know anything.
BUG=skia:
Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da
Reviewed-on: https://skia-review.googlesource.com/5748
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/core/SkBitmapProvider.h b/src/core/SkBitmapProvider.h
index 9ea2442..54f2877 100644
--- a/src/core/SkBitmapProvider.h
+++ b/src/core/SkBitmapProvider.h
@@ -13,20 +13,20 @@
class SkBitmapProvider {
public:
- explicit SkBitmapProvider(const SkImage* img, SkDestinationSurfaceColorMode colorMode)
+ explicit SkBitmapProvider(const SkImage* img, SkColorSpace* dstColorSpace)
: fImage(img)
- , fColorMode(colorMode) {
+ , fDstColorSpace(dstColorSpace) {
SkASSERT(img);
}
SkBitmapProvider(const SkBitmapProvider& other)
: fImage(other.fImage)
- , fColorMode(other.fColorMode)
+ , fDstColorSpace(other.fDstColorSpace)
{}
int width() const;
int height() const;
uint32_t getID() const;
- SkDestinationSurfaceColorMode colorMode() const { return fColorMode; }
+ SkColorSpace* dstColorSpace() const { return fDstColorSpace; }
SkImageInfo info() const;
bool isVolatile() const;
@@ -48,10 +48,10 @@
void* operator new(size_t) = delete;
void* operator new(size_t, void*) = delete;
- // SkBitmapProvider is always short-lived/stack allocated, and the source image is guaranteed
- // to outlive its scope => we can store a raw ptr to avoid ref churn.
- const SkImage* fImage;
- SkDestinationSurfaceColorMode fColorMode;
+ // SkBitmapProvider is always short-lived/stack allocated, and the source image and destination
+ // color space are guaranteed to outlive its scope => we can store raw ptrs to avoid ref churn.
+ const SkImage* fImage;
+ SkColorSpace* fDstColorSpace;
};
#endif