gfx/skia/trunk/src/core/SkRasterizer.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 "SkRasterizer.h"
    11 #include "SkDraw.h"
    12 #include "SkMaskFilter.h"
    13 #include "SkPath.h"
    15 bool SkRasterizer::rasterize(const SkPath& fillPath, const SkMatrix& matrix,
    16                              const SkIRect* clipBounds, SkMaskFilter* filter,
    17                              SkMask* mask, SkMask::CreateMode mode) const {
    18     SkIRect storage;
    20     if (clipBounds && filter && SkMask::kJustRenderImage_CreateMode != mode) {
    21         SkIPoint    margin;
    22         SkMask      srcM, dstM;
    24         srcM.fFormat = SkMask::kA8_Format;
    25         srcM.fBounds.set(0, 0, 1, 1);
    26         srcM.fImage = NULL;
    27         if (!filter->filterMask(&dstM, srcM, matrix, &margin)) {
    28             return false;
    29         }
    30         storage = *clipBounds;
    31         storage.inset(-margin.fX, -margin.fY);
    32         clipBounds = &storage;
    33     }
    35     return this->onRasterize(fillPath, matrix, clipBounds, mask, mode);
    36 }
    38 /*  Our default implementation of the virtual method just scan converts
    39 */
    40 bool SkRasterizer::onRasterize(const SkPath& fillPath, const SkMatrix& matrix,
    41                              const SkIRect* clipBounds,
    42                              SkMask* mask, SkMask::CreateMode mode) const {
    43     SkPath  devPath;
    45     fillPath.transform(matrix, &devPath);
    46     return SkDraw::DrawToMask(devPath, clipBounds, NULL, NULL, mask, mode,
    47                               SkPaint::kFill_Style);
    48 }

mercurial