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

Side by Side Diff: src/images/SkImageDecoder.cpp

Issue 14678003: Force linking with image decoders for images project. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: respond to comment Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « gyp/images.gyp ('k') | tools/skimage_main.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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 if (kUnknown_Format == *format) { 332 if (kUnknown_Format == *format) {
333 if (stream->rewind()) { 333 if (stream->rewind()) {
334 *format = GetStreamFormat(stream); 334 *format = GetStreamFormat(stream);
335 } 335 }
336 } 336 }
337 } 337 }
338 delete codec; 338 delete codec;
339 } 339 }
340 return success; 340 return success;
341 } 341 }
342
343 namespace {
344 /**
345 * This function leaks, but that is okay because it is not intended
346 * to be called. It is only here so that the linker will include the
347 * decoders.
348 * Make sure to keep it in sync with images.gyp, so only the encoders
349 * which are created on a platform are linked.
350 */
351 void force_linking() {
352 SkASSERT(false);
353 CreateJPEGImageDecoder();
354 CreateWEBPImageDecoder();
355 CreateBMPImageDecoder();
356 CreateICOImageDecoder();
357 CreateWBMPImageDecoder();
358 // Only link GIF and PNG on platforms that build them. See images.gyp
359 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUIL D_FOR_NACL)
360 CreateGIFImageDecoder();
361 #endif
362 #if !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_WIN)
363 CreatePNGImageDecoder();
364 #endif
365 }
366 }
OLDNEW
« no previous file with comments | « gyp/images.gyp ('k') | tools/skimage_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698