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.

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

mercurial