gfx/skia/trunk/include/core/SkLineClipper.h

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 2011 Google Inc.
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 #ifndef SkLineClipper_DEFINED
michael@0 9 #define SkLineClipper_DEFINED
michael@0 10
michael@0 11 #include "SkRect.h"
michael@0 12 #include "SkPoint.h"
michael@0 13
michael@0 14 class SkLineClipper {
michael@0 15 public:
michael@0 16 enum {
michael@0 17 kMaxPoints = 4,
michael@0 18 kMaxClippedLineSegments = kMaxPoints - 1
michael@0 19 };
michael@0 20
michael@0 21 /* Clip the line pts[0]...pts[1] against clip, ignoring segments that
michael@0 22 lie completely above or below the clip. For portions to the left or
michael@0 23 right, turn those into vertical line segments that are aligned to the
michael@0 24 edge of the clip.
michael@0 25
michael@0 26 Return the number of line segments that result, and store the end-points
michael@0 27 of those segments sequentially in lines as follows:
michael@0 28 1st segment: lines[0]..lines[1]
michael@0 29 2nd segment: lines[1]..lines[2]
michael@0 30 3rd segment: lines[2]..lines[3]
michael@0 31 */
michael@0 32 static int ClipLine(const SkPoint pts[2], const SkRect& clip,
michael@0 33 SkPoint lines[kMaxPoints]);
michael@0 34
michael@0 35 /* Intersect the line segment against the rect. If there is a non-empty
michael@0 36 resulting segment, return true and set dst[] to that segment. If not,
michael@0 37 return false and ignore dst[].
michael@0 38
michael@0 39 ClipLine is specialized for scan-conversion, as it adds vertical
michael@0 40 segments on the sides to show where the line extended beyond the
michael@0 41 left or right sides. IntersectLine does not.
michael@0 42 */
michael@0 43 static bool IntersectLine(const SkPoint src[2], const SkRect& clip,
michael@0 44 SkPoint dst[2]);
michael@0 45 };
michael@0 46
michael@0 47 #endif

mercurial