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.

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

mercurial