gfx/skia/trunk/src/core/SkBlitMask.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 * Copyright 2011 Google Inc.
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef SkBlitMask_DEFINED
michael@0 9 #define SkBlitMask_DEFINED
michael@0 10
michael@0 11 #include "SkBitmap.h"
michael@0 12 #include "SkColor.h"
michael@0 13 #include "SkMask.h"
michael@0 14
michael@0 15 class SkBlitMask {
michael@0 16 public:
michael@0 17 /**
michael@0 18 * Returns true if the device config and mask format were supported.
michael@0 19 * else return false (nothing was drawn)
michael@0 20 */
michael@0 21 static bool BlitColor(const SkBitmap& device, const SkMask& mask,
michael@0 22 const SkIRect& clip, SkColor color);
michael@0 23
michael@0 24 /**
michael@0 25 * Function pointer that blits the mask into a device (dst) colorized
michael@0 26 * by color. The number of pixels to blit is specified by width and height,
michael@0 27 * but each scanline is offset by dstRB (rowbytes) and srcRB respectively.
michael@0 28 */
michael@0 29 typedef void (*ColorProc)(void* dst, size_t dstRB,
michael@0 30 const void* mask, size_t maskRB,
michael@0 31 SkColor color, int width, int height);
michael@0 32
michael@0 33 /**
michael@0 34 * Function pointer that blits a row of mask(lcd16) into a row of dst
michael@0 35 * colorized by a single color. The number of pixels to blit is specified
michael@0 36 * by width.
michael@0 37 */
michael@0 38 typedef void (*BlitLCD16RowProc)(SkPMColor dst[], const uint16_t src[],
michael@0 39 SkColor color, int width,
michael@0 40 SkPMColor opaqueDst);
michael@0 41
michael@0 42 /**
michael@0 43 * Function pointer that blits a row of src colors through a row of a mask
michael@0 44 * onto a row of dst colors. The RowFactory that returns this function ptr
michael@0 45 * will have been told the formats for the mask and the dst.
michael@0 46 */
michael@0 47 typedef void (*RowProc)(void* dst, const void* mask,
michael@0 48 const SkPMColor* src, int width);
michael@0 49
michael@0 50 /**
michael@0 51 * Public entry-point to return a blitmask ColorProc.
michael@0 52 * May return NULL if config or format are not supported.
michael@0 53 */
michael@0 54 static ColorProc ColorFactory(SkBitmap::Config, SkMask::Format, SkColor);
michael@0 55
michael@0 56 /**
michael@0 57 * Return either platform specific optimized blitmask ColorProc,
michael@0 58 * or NULL if no optimized routine is available.
michael@0 59 */
michael@0 60 static ColorProc PlatformColorProcs(SkBitmap::Config, SkMask::Format, SkColor);
michael@0 61
michael@0 62 /**
michael@0 63 * Public entry-point to return a blitcolor BlitLCD16RowProc.
michael@0 64 */
michael@0 65 static BlitLCD16RowProc BlitLCD16RowFactory(bool isOpaque);
michael@0 66
michael@0 67 /**
michael@0 68 * Return either platform specific optimized blitcolor BlitLCD16RowProc,
michael@0 69 * or NULL if no optimized routine is available.
michael@0 70 */
michael@0 71 static BlitLCD16RowProc PlatformBlitRowProcs16(bool isOpaque);
michael@0 72
michael@0 73 enum RowFlags {
michael@0 74 kSrcIsOpaque_RowFlag = 1 << 0
michael@0 75 };
michael@0 76
michael@0 77 /**
michael@0 78 * Public entry-point to return a blitmask RowProc.
michael@0 79 * May return NULL if config or format are not supported.
michael@0 80 */
michael@0 81 static RowProc RowFactory(SkBitmap::Config, SkMask::Format, RowFlags);
michael@0 82
michael@0 83 /**
michael@0 84 * Return either platform specific optimized blitmask RowProc,
michael@0 85 * or NULL if no optimized routine is available.
michael@0 86 */
michael@0 87 static RowProc PlatformRowProcs(SkBitmap::Config, SkMask::Format, RowFlags);
michael@0 88 };
michael@0 89
michael@0 90 #endif

mercurial