OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
219 // has been baked into the pixel values. | 219 // has been baked into the pixel values. |
220 bool hasEmbeddedColorSpace() const { return m_embeddedColorSpace.get(); } | 220 bool hasEmbeddedColorSpace() const { return m_embeddedColorSpace.get(); } |
221 | 221 |
222 // Set the embedded color space directly or via ICC profile. | 222 // Set the embedded color space directly or via ICC profile. |
223 void setEmbeddedColorProfile(const char* iccData, unsigned iccLength); | 223 void setEmbeddedColorProfile(const char* iccData, unsigned iccLength); |
224 void setEmbeddedColorSpace(sk_sp<SkColorSpace> srcSpace); | 224 void setEmbeddedColorSpace(sk_sp<SkColorSpace> srcSpace); |
225 | 225 |
226 // Transformation from embedded color space to target color space. | 226 // Transformation from embedded color space to target color space. |
227 SkColorSpaceXform* colorTransform(); | 227 SkColorSpaceXform* colorTransform(); |
228 | 228 |
229 AlphaOption alphaOption() const { | |
230 return m_premultiplyAlpha ? AlphaPremultiplied : AlphaNotPremultiplied; | |
scroggo_chromium
2017/04/07 18:06:06
I wonder if we should store an AlphaOption instead
msarett1
2017/04/10 14:42:46
I think it makes more sense to store the AlphaOpti
scroggo_chromium
2017/04/10 17:31:23
sgtm
| |
231 } | |
232 | |
229 // Sets the "decode failure" flag. For caller convenience (since so | 233 // Sets the "decode failure" flag. For caller convenience (since so |
230 // many callers want to return false after calling this), returns false | 234 // many callers want to return false after calling this), returns false |
231 // to enable easy tailcalling. Subclasses may override this to also | 235 // to enable easy tailcalling. Subclasses may override this to also |
232 // clean up any local data. | 236 // clean up any local data. |
233 virtual bool setFailed() { | 237 virtual bool setFailed() { |
234 m_failed = true; | 238 m_failed = true; |
235 return false; | 239 return false; |
236 } | 240 } |
237 | 241 |
238 bool failed() const { return m_failed; } | 242 bool failed() const { return m_failed; } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 bool m_hasHistogrammedColorSpace = false; | 427 bool m_hasHistogrammedColorSpace = false; |
424 | 428 |
425 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; | 429 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; |
426 bool m_sourceToTargetColorTransformNeedsUpdate = false; | 430 bool m_sourceToTargetColorTransformNeedsUpdate = false; |
427 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; | 431 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; |
428 }; | 432 }; |
429 | 433 |
430 } // namespace blink | 434 } // namespace blink |
431 | 435 |
432 #endif | 436 #endif |
OLD | NEW |