gfx/layers/d3d9/ImageLayerD3D9.h

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:2d0178533808
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
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/. */
5
6 #ifndef GFX_IMAGELAYERD3D9_H
7 #define GFX_IMAGELAYERD3D9_H
8
9 #include "LayerManagerD3D9.h"
10 #include "ImageLayers.h"
11 #include "ImageContainer.h"
12 #include "yuv_convert.h"
13
14 namespace mozilla {
15 namespace layers {
16
17 class ImageLayerD3D9 : public ImageLayer,
18 public LayerD3D9
19 {
20 public:
21 ImageLayerD3D9(LayerManagerD3D9 *aManager)
22 : ImageLayer(aManager, nullptr)
23 , LayerD3D9(aManager)
24 {
25 mImplData = static_cast<LayerD3D9*>(this);
26 }
27
28 // LayerD3D9 Implementation
29 virtual Layer* GetLayer();
30
31 virtual void RenderLayer();
32
33 virtual already_AddRefed<IDirect3DTexture9> GetAsTexture(gfx::IntSize* aSize);
34
35 private:
36 IDirect3DTexture9* GetTexture(Image *aImage, bool& aHasAlpha);
37 };
38
39
40 struct TextureD3D9BackendData : public ImageBackendData
41 {
42 nsRefPtr<IDirect3DTexture9> mTexture;
43 };
44
45 struct PlanarYCbCrD3D9BackendData : public ImageBackendData
46 {
47 nsRefPtr<IDirect3DTexture9> mYTexture;
48 nsRefPtr<IDirect3DTexture9> mCrTexture;
49 nsRefPtr<IDirect3DTexture9> mCbTexture;
50 };
51
52 } /* layers */
53 } /* mozilla */
54 #endif /* GFX_IMAGELAYERD3D9_H */

mercurial