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

Side by Side Diff: Source/platform/graphics/ImageFrameGenerator.cpp

Issue 183833011: SkBitmap::Config is deprecated, switch to using SkColorType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « Source/platform/DragImage.cpp ('k') | Source/platform/image-decoders/ImageFrame.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 return ScaledImageFragment::createComplete(m_fullSize, index, fullSizeBi tmap); 306 return ScaledImageFragment::createComplete(m_fullSize, index, fullSizeBi tmap);
307 307
308 // If the image is progressively decoded we need to return a copy. 308 // If the image is progressively decoded we need to return a copy.
309 // This is to avoid future decode operations writing to the same bitmap. 309 // This is to avoid future decode operations writing to the same bitmap.
310 // FIXME: Note that discardable allocator is used. This is because the code 310 // FIXME: Note that discardable allocator is used. This is because the code
311 // is still used in the Android discardable memory path. When this code is 311 // is still used in the Android discardable memory path. When this code is
312 // used in the Skia discardable memory path |m_discardableAllocator| is empt y. 312 // used in the Skia discardable memory path |m_discardableAllocator| is empt y.
313 // This is confusing and should be cleaned up when we can deprecate the use 313 // This is confusing and should be cleaned up when we can deprecate the use
314 // case for Android discardable memory. 314 // case for Android discardable memory.
315 SkBitmap copyBitmap; 315 SkBitmap copyBitmap;
316 if (!fullSizeBitmap.copyTo(&copyBitmap, fullSizeBitmap.config(), m_discardab leAllocator.get())) 316 if (!fullSizeBitmap.copyTo(&copyBitmap, fullSizeBitmap.colorType(), m_discar dableAllocator.get()))
317 return nullptr; 317 return nullptr;
318 318
319 if (isCacheComplete) 319 if (isCacheComplete)
320 return ScaledImageFragment::createComplete(m_fullSize, index, copyBitmap ); 320 return ScaledImageFragment::createComplete(m_fullSize, index, copyBitmap );
321 return ScaledImageFragment::createPartial(m_fullSize, index, nextGenerationI d(), copyBitmap); 321 return ScaledImageFragment::createPartial(m_fullSize, index, nextGenerationI d(), copyBitmap);
322 } 322 }
323 323
324 bool ImageFrameGenerator::hasAlpha(size_t index) 324 bool ImageFrameGenerator::hasAlpha(size_t index)
325 { 325 {
326 MutexLocker lock(m_alphaMutex); 326 MutexLocker lock(m_alphaMutex);
327 if (index < m_hasAlpha.size()) 327 if (index < m_hasAlpha.size())
328 return m_hasAlpha[index]; 328 return m_hasAlpha[index];
329 return true; 329 return true;
330 } 330 }
331 331
332 } // namespace 332 } // namespace
OLDNEW
« no previous file with comments | « Source/platform/DragImage.cpp ('k') | Source/platform/image-decoders/ImageFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698