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

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: Add fColorProfile to SkCodec 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 | « no previous file | include/core/SkColorSpace.h » ('j') | src/codec/SkPngCodec.cpp » ('J')
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..097578d764ee360e1baa6688d67c7d983a17a603 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,12 @@ public:
const SkImageInfo& getInfo() const { return fSrcInfo; }
/**
+ * Returns the color space associated with the codec.
scroggo 2016/02/24 13:58:12 Does not affect ownership
msarett 2016/02/24 17:32:35 Done.
+ * 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 +509,7 @@ public:
int outputScanline(int inputScanline) const;
protected:
- SkCodec(const SkImageInfo&, SkStream*);
+ SkCodec(const SkImageInfo&, SkStream*, SkColorSpace* colorSpace = nullptr);
scroggo 2016/02/24 13:58:12 Takes ownership (I guess it already does with SkSt
msarett 2016/02/24 17:32:35 I'm going with "Refs the SkColorSpace*". Done.
virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const {
// By default, scaling is not supported.
@@ -630,13 +637,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;
+ SkAutoTDelete<SkColorSpace> fColorSpace;
scroggo 2016/02/24 13:58:12 It looks like SkColorSpace is ref-counted, so this
msarett 2016/02/24 17:32:35 Yes I think you're right.
+
// 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 | « no previous file | include/core/SkColorSpace.h » ('j') | src/codec/SkPngCodec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698