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.

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

mercurial