Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/gfx/layers/mlgpu/TextureSourceProviderMLGPU.h
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_gfx_layers_mlgpu_TextureSourceProviderMLGPU_h
8
#define mozilla_gfx_layers_mlgpu_TextureSourceProviderMLGPU_h
9
10
#include "mozilla/layers/TextureSourceProvider.h"
11
12
namespace mozilla {
13
namespace layers {
14
15
class MLGDevice;
16
class LayerManagerMLGPU;
17
18
class TextureSourceProviderMLGPU final : public TextureSourceProvider
19
{
20
public:
21
  TextureSourceProviderMLGPU(LayerManagerMLGPU* aLayerManager, MLGDevice* aDevice);
22
  ~TextureSourceProviderMLGPU() override;
23
24
  already_AddRefed<DataTextureSource>
25
  CreateDataTextureSource(TextureFlags aFlags) override;
26
27
  already_AddRefed<DataTextureSource>
28
  CreateDataTextureSourceAround(gfx::DataSourceSurface* aSurface) override;
29
30
  void UnlockAfterComposition(TextureHost* aTexture) override;
31
  bool NotifyNotUsedAfterComposition(TextureHost* aTextureHost) override;
32
33
  int32_t GetMaxTextureSize() const override;
34
  TimeStamp GetLastCompositionEndTime() const override;
35
  bool SupportsEffect(EffectTypes aEffect) override;
36
  bool IsValid() const override;
37
38
#ifdef XP_WIN
39
  virtual ID3D11Device* GetD3D11Device() const override;
40
#endif
41
42
0
  void ReadUnlockTextures() {
43
0
    TextureSourceProvider::ReadUnlockTextures();
44
0
  }
45
46
  // Release references to the layer manager.
47
  void Destroy() override;
48
49
private:
50
  // Using RefPtr<> here would be a circular reference.
51
  LayerManagerMLGPU* mLayerManager;
52
  RefPtr<MLGDevice> mDevice;
53
};
54
55
} // namespace layers
56
} // namespace mozilla
57
58
#endif // mozilla_gfx_layers_mlgpu_TextureSourceProviderMLGPU_h