| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // SkImages created from this decoder. This will be nullptr unless the | 216 // SkImages created from this decoder. This will be nullptr unless the |
| 217 // decoder was created with the option ColorSpaceTagged. | 217 // decoder was created with the option ColorSpaceTagged. |
| 218 sk_sp<SkColorSpace> ColorSpaceForSkImages() const; | 218 sk_sp<SkColorSpace> ColorSpaceForSkImages() const; |
| 219 | 219 |
| 220 // This returns whether or not the image included a not-ignored embedded | 220 // This returns whether or not the image included a not-ignored embedded |
| 221 // color space. This is independent of whether or not that space's transform | 221 // color space. This is independent of whether or not that space's transform |
| 222 // has been baked into the pixel values. | 222 // has been baked into the pixel values. |
| 223 bool HasEmbeddedColorSpace() const { return embedded_color_space_.get(); } | 223 bool HasEmbeddedColorSpace() const { return embedded_color_space_.get(); } |
| 224 | 224 |
| 225 // Set the embedded color space directly or via ICC profile. | 225 // Set the embedded color space directly or via ICC profile. |
| 226 void SetEmbeddedColorProfile(const char* icc_data, unsigned icc_length); | 226 void SetEmbeddedColorProfile(const char* icc_data, |
| 227 unsigned icc_length, |
| 228 SkColorSpace::ICCTypeFlag); |
| 227 void SetEmbeddedColorSpace(sk_sp<SkColorSpace> src_space); | 229 void SetEmbeddedColorSpace(sk_sp<SkColorSpace> src_space); |
| 228 | 230 |
| 229 // Transformation from embedded color space to target color space. | 231 // Transformation from embedded color space to target color space. |
| 230 SkColorSpaceXform* ColorTransform(); | 232 SkColorSpaceXform* ColorTransform(); |
| 231 | 233 |
| 232 AlphaOption GetAlphaOption() const { | 234 AlphaOption GetAlphaOption() const { |
| 233 return premultiply_alpha_ ? kAlphaPremultiplied : kAlphaNotPremultiplied; | 235 return premultiply_alpha_ ? kAlphaPremultiplied : kAlphaNotPremultiplied; |
| 234 } | 236 } |
| 235 | 237 |
| 236 // Sets the "decode failure" flag. For caller convenience (since so | 238 // Sets the "decode failure" flag. For caller convenience (since so |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 bool has_histogrammed_color_space_ = false; | 429 bool has_histogrammed_color_space_ = false; |
| 428 | 430 |
| 429 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; | 431 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; |
| 430 bool source_to_target_color_transform_needs_update_ = false; | 432 bool source_to_target_color_transform_needs_update_ = false; |
| 431 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; | 433 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; |
| 432 }; | 434 }; |
| 433 | 435 |
| 434 } // namespace blink | 436 } // namespace blink |
| 435 | 437 |
| 436 #endif | 438 #endif |
| OLD | NEW |