gfx/layers/d3d10/CanvasLayerD3D10.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 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef GFX_CANVASLAYERD3D10_H
     7 #define GFX_CANVASLAYERD3D10_H
     9 #include "LayerManagerD3D10.h"
    11 #include "mozilla/Preferences.h"
    13 namespace mozilla {
    15 namespace gl {
    16 class GLContext;
    17 }
    19 namespace layers {
    21 class CanvasLayerD3D10 : public CanvasLayer,
    22                          public LayerD3D10
    23 {
    24 public:
    25   CanvasLayerD3D10(LayerManagerD3D10 *aManager);
    26   ~CanvasLayerD3D10();
    28   // CanvasLayer implementation
    29   virtual void Initialize(const Data& aData);
    31   // LayerD3D10 implementation
    32   virtual Layer* GetLayer();
    33   virtual void RenderLayer();
    35 private:
    36   typedef mozilla::gl::GLContext GLContext;
    38   void UpdateSurface();
    40   RefPtr<gfx::SourceSurface> mSurface;
    41   mozilla::RefPtr<mozilla::gfx::DrawTarget> mDrawTarget;
    42   nsRefPtr<GLContext> mGLContext;
    43   nsRefPtr<ID3D10Texture2D> mTexture;
    44   nsRefPtr<ID3D10ShaderResourceView> mUploadSRView;
    45   nsRefPtr<ID3D10ShaderResourceView> mSRView;
    47   bool mDataIsPremultiplied;
    48   bool mNeedsYFlip;
    49   bool mIsD2DTexture;
    50   bool mHasAlpha;
    52   nsAutoArrayPtr<uint8_t> mCachedTempBlob;
    53   uint32_t mCachedTempBlob_Size;
    55   uint8_t* GetTempBlob(const uint32_t aSize)
    56   {
    57     if (!mCachedTempBlob || aSize != mCachedTempBlob_Size) {
    58       mCachedTempBlob = new uint8_t[aSize];
    59       mCachedTempBlob_Size = aSize;
    60     }
    62     return mCachedTempBlob;
    63   }
    65   void DiscardTempBlob()
    66   {
    67     mCachedTempBlob = nullptr;
    68   }
    69 };
    71 } /* layers */
    72 } /* mozilla */
    73 #endif /* GFX_CANVASLAYERD3D10_H */

mercurial