gfx/skia/trunk/include/effects/SkBitmapSource.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.

     1 /*
     2  * Copyright 2012 The Android Open Source Project
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef SkBitmapSource_DEFINED
     9 #define SkBitmapSource_DEFINED
    11 #include "SkImageFilter.h"
    12 #include "SkBitmap.h"
    14 class SK_API SkBitmapSource : public SkImageFilter {
    15 public:
    16     static SkBitmapSource* Create(const SkBitmap& bitmap) {
    17         return SkNEW_ARGS(SkBitmapSource, (bitmap));
    18     }
    19     static SkBitmapSource* Create(const SkBitmap& bitmap, const SkRect& srcRect,
    20                                   const SkRect& dstRect) {
    21         return SkNEW_ARGS(SkBitmapSource, (bitmap, srcRect, dstRect));
    22     }
    23     virtual void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVERRIDE;
    25     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkBitmapSource)
    27 protected:
    28     explicit SkBitmapSource(SkReadBuffer& buffer);
    29     virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
    30     virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
    31                                SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
    32     virtual bool onFilterBounds(const SkIRect& src, const SkMatrix& ctm, SkIRect* dst) const SK_OVERRIDE;
    34 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
    35 public:
    36 #endif
    37     explicit SkBitmapSource(const SkBitmap& bitmap);
    38     SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect);
    40 private:
    41     SkBitmap fBitmap;
    42     SkRect   fSrcRect, fDstRect;
    43     typedef SkImageFilter INHERITED;
    44 };
    46 #endif

mercurial