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 embedded_color_space_.get(); } | 220 bool HasEmbeddedColorSpace() const { return embedded_color_space_.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* icc_data, unsigned icc_length); | 223 void SetEmbeddedColorProfile(const char* icc_data, unsigned icc_length); |
224 void SetEmbeddedColorSpace(sk_sp<SkColorSpace> src_space); | 224 void SetEmbeddedColorSpace(sk_sp<SkColorSpace> src_space); |
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 GetAlphaOption() const { |
| 230 return premultiply_alpha_ ? kAlphaPremultiplied : kAlphaNotPremultiplied; |
| 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 failed_ = true; | 238 failed_ = true; |
235 return false; | 239 return false; |
236 } | 240 } |
237 | 241 |
238 bool Failed() const { return failed_; } | 242 bool Failed() const { return failed_; } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 bool has_histogrammed_color_space_ = false; | 428 bool has_histogrammed_color_space_ = false; |
425 | 429 |
426 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; | 430 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; |
427 bool source_to_target_color_transform_needs_update_ = false; | 431 bool source_to_target_color_transform_needs_update_ = false; |
428 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; | 432 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; |
429 }; | 433 }; |
430 | 434 |
431 } // namespace blink | 435 } // namespace blink |
432 | 436 |
433 #endif | 437 #endif |
OLD | NEW |