gfx/skia/trunk/src/gpu/GrDrawTargetCaps.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 2013 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 GrDrawTargetCaps_DEFINED
michael@0 9 #define GrDrawTargetCaps_DEFINED
michael@0 10
michael@0 11 #include "GrTypes.h"
michael@0 12 #include "SkRefCnt.h"
michael@0 13 #include "SkString.h"
michael@0 14
michael@0 15 /**
michael@0 16 * Represents the draw target capabilities.
michael@0 17 */
michael@0 18 class GrDrawTargetCaps : public SkRefCnt {
michael@0 19 public:
michael@0 20 SK_DECLARE_INST_COUNT(Caps)
michael@0 21
michael@0 22 GrDrawTargetCaps() { this->reset(); }
michael@0 23 GrDrawTargetCaps(const GrDrawTargetCaps& other) : INHERITED() { *this = other; }
michael@0 24 GrDrawTargetCaps& operator= (const GrDrawTargetCaps&);
michael@0 25
michael@0 26 virtual void reset();
michael@0 27 virtual SkString dump() const;
michael@0 28
michael@0 29 bool eightBitPaletteSupport() const { return f8BitPaletteSupport; }
michael@0 30 bool npotTextureTileSupport() const { return fNPOTTextureTileSupport; }
michael@0 31 /** To avoid as-yet-unnecessary complexity we don't allow any partial support of MIP Maps (e.g.
michael@0 32 only for POT textures) */
michael@0 33 bool mipMapSupport() const { return fMipMapSupport; }
michael@0 34 bool twoSidedStencilSupport() const { return fTwoSidedStencilSupport; }
michael@0 35 bool stencilWrapOpsSupport() const { return fStencilWrapOpsSupport; }
michael@0 36 bool hwAALineSupport() const { return fHWAALineSupport; }
michael@0 37 bool shaderDerivativeSupport() const { return fShaderDerivativeSupport; }
michael@0 38 bool geometryShaderSupport() const { return fGeometryShaderSupport; }
michael@0 39 bool dualSourceBlendingSupport() const { return fDualSourceBlendingSupport; }
michael@0 40 bool bufferLockSupport() const { return fBufferLockSupport; }
michael@0 41 bool pathRenderingSupport() const { return fPathRenderingSupport; }
michael@0 42 bool dstReadInShaderSupport() const { return fDstReadInShaderSupport; }
michael@0 43 bool gpuTracingSupport() const { return fGpuTracingSupport; }
michael@0 44
michael@0 45 // Scratch textures not being reused means that those scratch textures
michael@0 46 // that we upload to (i.e., don't have a render target) will not be
michael@0 47 // recycled in the texture cache. This is to prevent ghosting by drivers
michael@0 48 // (in particular for deferred architectures).
michael@0 49 bool reuseScratchTextures() const { return fReuseScratchTextures; }
michael@0 50
michael@0 51 int maxRenderTargetSize() const { return fMaxRenderTargetSize; }
michael@0 52 int maxTextureSize() const { return fMaxTextureSize; }
michael@0 53 // Will be 0 if MSAA is not supported
michael@0 54 int maxSampleCount() const { return fMaxSampleCount; }
michael@0 55
michael@0 56 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const {
michael@0 57 SkASSERT(kGrPixelConfigCnt > config);
michael@0 58 return fConfigRenderSupport[config][withMSAA];
michael@0 59 }
michael@0 60
michael@0 61 protected:
michael@0 62 bool f8BitPaletteSupport : 1;
michael@0 63 bool fNPOTTextureTileSupport : 1;
michael@0 64 bool fMipMapSupport : 1;
michael@0 65 bool fTwoSidedStencilSupport : 1;
michael@0 66 bool fStencilWrapOpsSupport : 1;
michael@0 67 bool fHWAALineSupport : 1;
michael@0 68 bool fShaderDerivativeSupport : 1;
michael@0 69 bool fGeometryShaderSupport : 1;
michael@0 70 bool fDualSourceBlendingSupport : 1;
michael@0 71 bool fBufferLockSupport : 1;
michael@0 72 bool fPathRenderingSupport : 1;
michael@0 73 bool fDstReadInShaderSupport : 1;
michael@0 74 bool fReuseScratchTextures : 1;
michael@0 75 bool fGpuTracingSupport : 1;
michael@0 76
michael@0 77 int fMaxRenderTargetSize;
michael@0 78 int fMaxTextureSize;
michael@0 79 int fMaxSampleCount;
michael@0 80
michael@0 81 // The first entry for each config is without msaa and the second is with.
michael@0 82 bool fConfigRenderSupport[kGrPixelConfigCnt][2];
michael@0 83
michael@0 84 typedef SkRefCnt INHERITED;
michael@0 85 };
michael@0 86
michael@0 87 #endif

mercurial