Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: include/codec/SkCodec.h

Issue 1726823002: Set SkColorSpace object for PNGs and parse ICC profiles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/tools.gyp ('k') | resources/color_wheel_with_profile.png » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index c3a5873d7f9fb77e03027f684d573061bc9c3dd2..78295eb1fc5a393216bf6e856071ab0da41cf4f6 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -10,6 +10,7 @@
#include "../private/SkTemplates.h"
#include "SkColor.h"
+#include "SkColorSpace.h"
#include "SkEncodedFormat.h"
#include "SkImageInfo.h"
#include "SkSize.h"
@@ -99,6 +100,13 @@ public:
const SkImageInfo& getInfo() const { return fSrcInfo; }
/**
+ * Returns the color space associated with the codec.
+ * Does not affect ownership.
+ * Might be NULL.
+ */
+ SkColorSpace* getColorSpace() const { return fColorSpace; }
+
+ /**
* Return a size that approximately supports the desired scale factor.
* The codec may not be able to scale efficiently to the exact scale
* factor requested, so return a size that approximates that scale.
@@ -502,7 +510,11 @@ public:
int outputScanline(int inputScanline) const;
protected:
- SkCodec(const SkImageInfo&, SkStream*);
+ /**
+ * Takes ownership of SkStream*
+ * Does not affect ownership of SkColorSpace*
+ */
+ SkCodec(const SkImageInfo&, SkStream*, SkColorSpace* = nullptr);
virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const {
// By default, scaling is not supported.
@@ -630,13 +642,15 @@ protected:
virtual int onOutputScanline(int inputScanline) const;
private:
- const SkImageInfo fSrcInfo;
- SkAutoTDelete<SkStream> fStream;
- bool fNeedsRewind;
+ const SkImageInfo fSrcInfo;
+ SkAutoTDelete<SkStream> fStream;
+ bool fNeedsRewind;
+ SkAutoTUnref<SkColorSpace> fColorSpace;
+
// These fields are only meaningful during scanline decodes.
- SkImageInfo fDstInfo;
- SkCodec::Options fOptions;
- int fCurrScanline;
+ SkImageInfo fDstInfo;
+ SkCodec::Options fOptions;
+ int fCurrScanline;
/**
* Return whether these dimensions are supported as a scale.
« no previous file with comments | « gyp/tools.gyp ('k') | resources/color_wheel_with_profile.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698