gfx/skia/trunk/src/core/SkMipMap.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 2013 Google Inc.
     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 SkMipMap_DEFINED
     9 #define SkMipMap_DEFINED
    11 #include "SkRefCnt.h"
    12 #include "SkScalar.h"
    14 class SkBitmap;
    16 class SkMipMap : public SkRefCnt {
    17 public:
    18     static SkMipMap* Build(const SkBitmap& src);
    20     struct Level {
    21         void*       fPixels;
    22         uint32_t    fRowBytes;
    23         uint32_t    fWidth, fHeight;
    24         float       fScale; // < 1.0
    25     };
    27     bool extractLevel(SkScalar scale, Level*) const;
    29     size_t getSize() const { return fSize; }
    31 private:
    32     size_t  fSize;
    33     Level*  fLevels;
    34     int     fCount;
    36     // we take ownership of levels, and will free it with sk_free()
    37     SkMipMap(Level* levels, int count, size_t size);
    38     virtual ~SkMipMap();
    40     static Level* AllocLevels(int levelCount, size_t pixelSize);
    41 };
    43 #endif

mercurial