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

Side by Side Diff: third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp

Issue 2462803002: Plumb color space to DecodingImageGenerator and ImageFrameGenerator (Closed)
Patch Set: Incorporate review feedback Created 4 years, 1 month 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) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
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 WebPChunkIterator chunkIterator; 335 WebPChunkIterator chunkIterator;
336 if (!WebPDemuxGetChunk(m_demux, "ICCP", 1, &chunkIterator)) { 336 if (!WebPDemuxGetChunk(m_demux, "ICCP", 1, &chunkIterator)) {
337 WebPDemuxReleaseChunkIterator(&chunkIterator); 337 WebPDemuxReleaseChunkIterator(&chunkIterator);
338 return; 338 return;
339 } 339 }
340 340
341 const char* profileData = 341 const char* profileData =
342 reinterpret_cast<const char*>(chunkIterator.chunk.bytes); 342 reinterpret_cast<const char*>(chunkIterator.chunk.bytes);
343 size_t profileSize = chunkIterator.chunk.size; 343 size_t profileSize = chunkIterator.chunk.size;
344 344
345 setColorSpaceAndComputeTransform(profileData, profileSize); 345 setColorProfileAndComputeTransform(profileData, profileSize);
346 346
347 WebPDemuxReleaseChunkIterator(&chunkIterator); 347 WebPDemuxReleaseChunkIterator(&chunkIterator);
348 } 348 }
349 349
350 void WEBPImageDecoder::applyPostProcessing(size_t frameIndex) { 350 void WEBPImageDecoder::applyPostProcessing(size_t frameIndex) {
351 ImageFrame& buffer = m_frameBufferCache[frameIndex]; 351 ImageFrame& buffer = m_frameBufferCache[frameIndex];
352 int width; 352 int width;
353 int decodedHeight; 353 int decodedHeight;
354 if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0)) 354 if (!WebPIDecGetRGB(m_decoder, &decodedHeight, &width, 0, 0))
355 return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062 355 return; // See also https://bugs.webkit.org/show_bug.cgi?id=74062
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 return false; 576 return false;
577 } 577 }
578 // FALLTHROUGH 578 // FALLTHROUGH
579 default: 579 default:
580 clear(); 580 clear();
581 return setFailed(); 581 return setFailed();
582 } 582 }
583 } 583 }
584 584
585 } // namespace blink 585 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698