gfx/skia/trunk/src/core/SkTextFormatParams.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     2 /*
     3  * Copyright 2010 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkTextFormatParams_DEFINES
    11 #define SkTextFormatParams_DEFINES
    13 #include "SkScalar.h"
    14 #include "SkTypes.h"
    16 // Fraction of the text size to lower a strike through line below the baseline.
    17 #define kStdStrikeThru_Offset       (-SK_Scalar1 * 6 / 21)
    18 // Fraction of the text size to lower a underline below the baseline.
    19 #define kStdUnderline_Offset        (SK_Scalar1 / 9)
    20 // Fraction of the text size to use for a strike through or under-line.
    21 #define kStdUnderline_Thickness     (SK_Scalar1 / 18)
    23 // The fraction of text size to embolden fake bold text scales with text size.
    24 // At 9 points or below, the stroke width is increased by text size / 24.
    25 // At 36 points and above, it is increased by text size / 32.  In between,
    26 // it is interpolated between those values.
    27 static const SkScalar kStdFakeBoldInterpKeys[] = {
    28     SK_Scalar1*9,
    29     SK_Scalar1*36,
    30 };
    31 static const SkScalar kStdFakeBoldInterpValues[] = {
    32     SK_Scalar1/24,
    33     SK_Scalar1/32
    34 };
    35 SK_COMPILE_ASSERT(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) ==
    36                   SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
    37                   mismatched_array_size);
    38 static const int kStdFakeBoldInterpLength =
    39     SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);
    41 #endif  //SkTextFormatParams_DEFINES

mercurial