Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h

Issue 2756463003: Remove opaque alpha channel special case (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 // last frame needs to be decoded first. Before calling this method, the 335 // last frame needs to be decoded first. Before calling this method, the
336 // caller must verify that the frame exists. 336 // caller must verify that the frame exists.
337 Vector<size_t> findFramesToDecode(size_t) const; 337 Vector<size_t> findFramesToDecode(size_t) const;
338 338
339 // This is called by decode() after decoding a frame in an animated image. 339 // This is called by decode() after decoding a frame in an animated image.
340 // Before calling this method, the caller must verify that the frame exists. 340 // Before calling this method, the caller must verify that the frame exists.
341 // @return true if the frame was fully decoded, 341 // @return true if the frame was fully decoded,
342 // false otherwise. 342 // false otherwise.
343 bool postDecodeProcessing(size_t); 343 bool postDecodeProcessing(size_t);
344 344
345 // The GIF and PNG decoders set the default alpha setting of the ImageFrame to
346 // true. When the frame rect does not contain any (semi-) transparent pixels,
347 // this may need to be changed to false. This depends on whether the required
348 // previous frame adds transparency to the image, outside of the frame rect.
349 // This methods corrects the alpha setting of the frame buffer to false when
350 // the whole frame is opaque.
351 //
352 // This method should be called by the GIF and PNG decoder when the pixels in
353 // the frame rect do *not* contain any transparent pixels. Before calling
354 // this method, the caller must verify that the frame exists.
355 void correctAlphaWhenFrameBufferSawNoAlpha(size_t);
356
357 RefPtr<SegmentReader> m_data; // The encoded data. 345 RefPtr<SegmentReader> m_data; // The encoded data.
358 Vector<ImageFrame, 1> m_frameBufferCache; 346 Vector<ImageFrame, 1> m_frameBufferCache;
359 const bool m_premultiplyAlpha; 347 const bool m_premultiplyAlpha;
360 const ColorBehavior m_colorBehavior; 348 const ColorBehavior m_colorBehavior;
361 ImageOrientation m_orientation; 349 ImageOrientation m_orientation;
362 350
363 // The maximum amount of memory a decoded image should require. Ideally, 351 // The maximum amount of memory a decoded image should require. Ideally,
364 // image decoders should downsample large images to fit under this limit 352 // image decoders should downsample large images to fit under this limit
365 // (and then return the downsampled size from decodedSize()). Ignoring 353 // (and then return the downsampled size from decodedSize()). Ignoring
366 // this limit can cause excessive memory use or even crashes on low- 354 // this limit can cause excessive memory use or even crashes on low-
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 bool m_hasHistogrammedColorSpace = false; 411 bool m_hasHistogrammedColorSpace = false;
424 412
425 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr; 413 sk_sp<SkColorSpace> m_embeddedColorSpace = nullptr;
426 bool m_sourceToTargetColorTransformNeedsUpdate = false; 414 bool m_sourceToTargetColorTransformNeedsUpdate = false;
427 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform; 415 std::unique_ptr<SkColorSpaceXform> m_sourceToTargetColorTransform;
428 }; 416 };
429 417
430 } // namespace blink 418 } // namespace blink
431 419
432 #endif 420 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698