gfx/skia/trunk/src/animator/SkDrawText.cpp

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 2006 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 #include "SkDrawText.h"
michael@0 11 #include "SkAnimateMaker.h"
michael@0 12 #include "SkCanvas.h"
michael@0 13 #include "SkPaint.h"
michael@0 14
michael@0 15 enum SkText_Properties {
michael@0 16 SK_PROPERTY(length)
michael@0 17 };
michael@0 18
michael@0 19 #if SK_USE_CONDENSED_INFO == 0
michael@0 20
michael@0 21 const SkMemberInfo SkText::fInfo[] = {
michael@0 22 SK_MEMBER_PROPERTY(length, Int),
michael@0 23 SK_MEMBER(text, String),
michael@0 24 SK_MEMBER(x, Float),
michael@0 25 SK_MEMBER(y, Float)
michael@0 26 };
michael@0 27
michael@0 28 #endif
michael@0 29
michael@0 30 DEFINE_GET_MEMBER(SkText);
michael@0 31
michael@0 32 SkText::SkText() : x(0), y(0) {
michael@0 33 }
michael@0 34
michael@0 35 SkText::~SkText() {
michael@0 36 }
michael@0 37
michael@0 38 bool SkText::draw(SkAnimateMaker& maker) {
michael@0 39 SkBoundableAuto boundable(this, maker);
michael@0 40 maker.fCanvas->drawText(text.c_str(), text.size(), x, y, *maker.fPaint);
michael@0 41 return false;
michael@0 42 }
michael@0 43
michael@0 44 #ifdef SK_DUMP_ENABLED
michael@0 45 void SkText::dump(SkAnimateMaker* maker) {
michael@0 46 INHERITED::dump(maker);
michael@0 47 }
michael@0 48 #endif
michael@0 49
michael@0 50 bool SkText::getProperty(int index, SkScriptValue* value) const {
michael@0 51 SkASSERT(index == SK_PROPERTY(length));
michael@0 52 value->fType = SkType_Int;
michael@0 53 value->fOperand.fS32 = (int32_t) text.size();
michael@0 54 return true;
michael@0 55 }

mercurial