gfx/skia/trunk/src/animator/SkPaintParts.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 "SkPaintParts.h"
michael@0 11 #include "SkDrawPaint.h"
michael@0 12 #ifdef SK_DUMP_ENABLED
michael@0 13 #include "SkDisplayList.h"
michael@0 14 #include "SkDump.h"
michael@0 15 #endif
michael@0 16
michael@0 17 SkPaintPart::SkPaintPart() : fPaint(NULL) {
michael@0 18 }
michael@0 19
michael@0 20 SkDisplayable* SkPaintPart::getParent() const {
michael@0 21 return fPaint;
michael@0 22 }
michael@0 23
michael@0 24 bool SkPaintPart::setParent(SkDisplayable* parent) {
michael@0 25 SkASSERT(parent != NULL);
michael@0 26 if (parent->isPaint() == false)
michael@0 27 return true;
michael@0 28 fPaint = (SkDrawPaint*) parent;
michael@0 29 return false;
michael@0 30 }
michael@0 31
michael@0 32
michael@0 33 // SkDrawMaskFilter
michael@0 34 bool SkDrawMaskFilter::add() {
michael@0 35 if (fPaint->maskFilter != (SkDrawMaskFilter*) -1)
michael@0 36 return true;
michael@0 37 fPaint->maskFilter = this;
michael@0 38 fPaint->fOwnsMaskFilter = true;
michael@0 39 return false;
michael@0 40 }
michael@0 41
michael@0 42 SkMaskFilter* SkDrawMaskFilter::getMaskFilter() {
michael@0 43 return NULL;
michael@0 44 }
michael@0 45
michael@0 46
michael@0 47 // SkDrawPathEffect
michael@0 48 bool SkDrawPathEffect::add() {
michael@0 49 if (fPaint->isPaint()) {
michael@0 50 if (fPaint->pathEffect != (SkDrawPathEffect*) -1)
michael@0 51 return true;
michael@0 52 fPaint->pathEffect = this;
michael@0 53 fPaint->fOwnsPathEffect = true;
michael@0 54 return false;
michael@0 55 }
michael@0 56 fPaint->add(NULL, this);
michael@0 57 return false;
michael@0 58 }
michael@0 59
michael@0 60 SkPathEffect* SkDrawPathEffect::getPathEffect() {
michael@0 61 return NULL;
michael@0 62 }
michael@0 63
michael@0 64
michael@0 65 // SkDrawShader
michael@0 66 SkShader* SkDrawShader::getShader() {
michael@0 67 return NULL;
michael@0 68 }
michael@0 69
michael@0 70
michael@0 71 // Typeface
michael@0 72 #if SK_USE_CONDENSED_INFO == 0
michael@0 73
michael@0 74 const SkMemberInfo SkDrawTypeface::fInfo[] = {
michael@0 75 SK_MEMBER(fontName, String),
michael@0 76 SK_MEMBER(style, FontStyle)
michael@0 77 };
michael@0 78
michael@0 79 #endif
michael@0 80
michael@0 81 DEFINE_GET_MEMBER(SkDrawTypeface);
michael@0 82
michael@0 83 SkDrawTypeface::SkDrawTypeface() : style (SkTypeface::kNormal){
michael@0 84 }
michael@0 85
michael@0 86 bool SkDrawTypeface::add() {
michael@0 87 if (fPaint->typeface != (SkDrawTypeface*) -1)
michael@0 88 return true;
michael@0 89 fPaint->typeface = this;
michael@0 90 fPaint->fOwnsTypeface = true;
michael@0 91 return false;
michael@0 92 }
michael@0 93
michael@0 94 #ifdef SK_DUMP_ENABLED
michael@0 95 void SkDrawTypeface::dump(SkAnimateMaker*) {
michael@0 96 SkDebugf("%*s<typeface fontName=\"%s\" ", SkDisplayList::fIndent, "", fontName.c_str());
michael@0 97 SkString string;
michael@0 98 SkDump::GetEnumString(SkType_FontStyle, style, &string);
michael@0 99 SkDebugf("style=\"%s\" />\n", string.c_str());
michael@0 100 }
michael@0 101 #endif

mercurial