gfx/skia/trunk/include/images/SkForceLinking.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/include/images/SkForceLinking.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,20 @@
     1.4 +/*
     1.5 + * Copyright 2013 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +/**
    1.12 + *  This function's sole purpose is to trick the linker into not discarding
    1.13 + *  SkImageDecoder subclasses just because we do not directly call them.
    1.14 + *  This is necessary in applications that will create image decoders from
    1.15 + *  a stream.
    1.16 + *  Call this function with an expression that evaluates to false to ensure
    1.17 + *  that the linker includes the subclasses.
    1.18 + *  Passing true will result in leaked objects.
    1.19 + */
    1.20 +int SkForceLinking(bool doNotPassTrue);
    1.21 +
    1.22 +#define __SK_FORCE_IMAGE_DECODER_LINKING       \
    1.23 +static int linking_forced = SkForceLinking(false)

mercurial