gfx/layers/d3d9/ThebesLayerD3D9.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 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef GFX_THEBESLAYERD3D9_H
michael@0 7 #define GFX_THEBESLAYERD3D9_H
michael@0 8
michael@0 9 #include "Layers.h"
michael@0 10 #include "LayerManagerD3D9.h"
michael@0 11 #include "ReadbackProcessor.h"
michael@0 12
michael@0 13 namespace mozilla {
michael@0 14 namespace layers {
michael@0 15
michael@0 16 class ReadbackProcessor;
michael@0 17
michael@0 18 class ThebesLayerD3D9 : public ThebesLayer,
michael@0 19 public LayerD3D9
michael@0 20 {
michael@0 21 public:
michael@0 22 ThebesLayerD3D9(LayerManagerD3D9 *aManager);
michael@0 23 virtual ~ThebesLayerD3D9();
michael@0 24
michael@0 25 /* ThebesLayer implementation */
michael@0 26 void InvalidateRegion(const nsIntRegion& aRegion);
michael@0 27
michael@0 28 /* LayerD3D9 implementation */
michael@0 29 Layer* GetLayer();
michael@0 30 virtual bool IsEmpty();
michael@0 31 virtual void RenderLayer() { RenderThebesLayer(nullptr); }
michael@0 32 virtual void CleanResources();
michael@0 33 virtual void LayerManagerDestroyed();
michael@0 34
michael@0 35 void RenderThebesLayer(ReadbackProcessor* aReadback);
michael@0 36
michael@0 37 private:
michael@0 38 /*
michael@0 39 * D3D9 texture
michael@0 40 */
michael@0 41 nsRefPtr<IDirect3DTexture9> mTexture;
michael@0 42 /*
michael@0 43 * D3D9 texture for render-on-white when doing component alpha
michael@0 44 */
michael@0 45 nsRefPtr<IDirect3DTexture9> mTextureOnWhite;
michael@0 46 /**
michael@0 47 * Visible region bounds used when we drew the contents of the textures
michael@0 48 */
michael@0 49 nsIntRect mTextureRect;
michael@0 50
michael@0 51 bool HaveTextures(SurfaceMode aMode)
michael@0 52 {
michael@0 53 return mTexture && (aMode != SurfaceMode::SURFACE_COMPONENT_ALPHA || mTextureOnWhite);
michael@0 54 }
michael@0 55
michael@0 56 /* Checks if our surface has the right content type */
michael@0 57 void VerifyContentType(SurfaceMode aMode);
michael@0 58
michael@0 59 /* Ensures we have the necessary texture object(s) and that they correspond
michael@0 60 * to mVisibleRegion.GetBounds(). This creates new texture objects as
michael@0 61 * necessary and also copies existing valid texture data if necessary.
michael@0 62 */
michael@0 63 void UpdateTextures(SurfaceMode aMode);
michael@0 64
michael@0 65 /* Render the rectangles of mVisibleRegion with D3D9 using the currently
michael@0 66 * bound textures, target, shaders, etc.
michael@0 67 */
michael@0 68 void RenderRegion(const nsIntRegion& aRegion);
michael@0 69
michael@0 70 /* Have a region of our layer drawn */
michael@0 71 void DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
michael@0 72 const nsTArray<ReadbackProcessor::Update>& aReadbackUpdates);
michael@0 73
michael@0 74 /* Create a new texture */
michael@0 75 void CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode);
michael@0 76
michael@0 77 void CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
michael@0 78 IDirect3DTexture9* aDest, const nsIntPoint &aDestOffset,
michael@0 79 const nsIntRegion &aCopyRegion, nsIntRegion* aValidRegion);
michael@0 80 };
michael@0 81
michael@0 82 } /* layers */
michael@0 83 } /* mozilla */
michael@0 84 #endif /* GFX_THEBESLAYERD3D9_H */

mercurial