| 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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // last frame needs to be decoded first. Before calling this method, the | 340 // last frame needs to be decoded first. Before calling this method, the |
| 341 // caller must verify that the frame exists. | 341 // caller must verify that the frame exists. |
| 342 Vector<size_t> FindFramesToDecode(size_t) const; | 342 Vector<size_t> FindFramesToDecode(size_t) const; |
| 343 | 343 |
| 344 // This is called by Decode() after decoding a frame in an animated image. | 344 // This is called by Decode() after decoding a frame in an animated image. |
| 345 // Before calling this method, the caller must verify that the frame exists. | 345 // Before calling this method, the caller must verify that the frame exists. |
| 346 // @return true if the frame was fully decoded, | 346 // @return true if the frame was fully decoded, |
| 347 // false otherwise. | 347 // false otherwise. |
| 348 bool PostDecodeProcessing(size_t); | 348 bool PostDecodeProcessing(size_t); |
| 349 | 349 |
| 350 // The GIF and PNG decoders set the default alpha setting of the ImageFrame to | |
| 351 // true. When the frame rect does not contain any (semi-) transparent pixels, | |
| 352 // this may need to be changed to false. This depends on whether the required | |
| 353 // previous frame adds transparency to the image, outside of the frame rect. | |
| 354 // This methods corrects the alpha setting of the frame buffer to false when | |
| 355 // the whole frame is opaque. | |
| 356 // | |
| 357 // This method should be called by the GIF and PNG decoder when the pixels in | |
| 358 // the frame rect do *not* contain any transparent pixels. Before calling | |
| 359 // this method, the caller must verify that the frame exists. | |
| 360 void CorrectAlphaWhenFrameBufferSawNoAlpha(size_t); | |
| 361 | |
| 362 RefPtr<SegmentReader> data_; // The encoded data. | 350 RefPtr<SegmentReader> data_; // The encoded data. |
| 363 Vector<ImageFrame, 1> frame_buffer_cache_; | 351 Vector<ImageFrame, 1> frame_buffer_cache_; |
| 364 const bool premultiply_alpha_; | 352 const bool premultiply_alpha_; |
| 365 const ColorBehavior color_behavior_; | 353 const ColorBehavior color_behavior_; |
| 366 ImageOrientation orientation_; | 354 ImageOrientation orientation_; |
| 367 | 355 |
| 368 // The maximum amount of memory a decoded image should require. Ideally, | 356 // The maximum amount of memory a decoded image should require. Ideally, |
| 369 // image decoders should downsample large images to fit under this limit | 357 // image decoders should downsample large images to fit under this limit |
| 370 // (and then return the downsampled size from DecodedSize()). Ignoring | 358 // (and then return the downsampled size from DecodedSize()). Ignoring |
| 371 // this limit can cause excessive memory use or even crashes on low- | 359 // this limit can cause excessive memory use or even crashes on low- |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 bool has_histogrammed_color_space_ = false; | 416 bool has_histogrammed_color_space_ = false; |
| 429 | 417 |
| 430 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; | 418 sk_sp<SkColorSpace> embedded_color_space_ = nullptr; |
| 431 bool source_to_target_color_transform_needs_update_ = false; | 419 bool source_to_target_color_transform_needs_update_ = false; |
| 432 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; | 420 std::unique_ptr<SkColorSpaceXform> source_to_target_color_transform_; |
| 433 }; | 421 }; |
| 434 | 422 |
| 435 } // namespace blink | 423 } // namespace blink |
| 436 | 424 |
| 437 #endif | 425 #endif |
| OLD | NEW |