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