Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/gfx/layers/ipc/SharedPlanarYCbCrImage.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
#include <stdint.h>                     // for uint8_t, uint32_t
8
#include "ImageContainer.h"             // for PlanarYCbCrImage, etc
9
#include "mozilla/Attributes.h"         // for override
10
#include "mozilla/RefPtr.h"             // for RefPtr
11
#include "mozilla/ipc/Shmem.h"          // for Shmem
12
#include "nsCOMPtr.h"                   // for already_AddRefed
13
#include "nsDebug.h"                    // for NS_WARNING
14
#include "nsISupportsImpl.h"            // for MOZ_COUNT_CTOR
15
16
#ifndef MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
17
#define MOZILLA_LAYERS_SHAREDPLANARYCBCRIMAGE_H
18
19
namespace mozilla {
20
namespace layers {
21
22
class ImageClient;
23
class TextureClient;
24
25
class SharedPlanarYCbCrImage : public PlanarYCbCrImage
26
{
27
public:
28
  explicit SharedPlanarYCbCrImage(ImageClient* aCompositable);
29
30
protected:
31
  virtual ~SharedPlanarYCbCrImage();
32
33
public:
34
  TextureClient* GetTextureClient(KnowsCompositor* aForwarder) override;
35
  uint8_t* GetBuffer() const override;
36
37
  already_AddRefed<gfx::SourceSurface> GetAsSourceSurface() override;
38
  bool CopyData(const PlanarYCbCrData& aData) override;
39
  bool AdoptData(const Data& aData) override;
40
41
  bool Allocate(PlanarYCbCrData& aData);
42
43
  bool IsValid() const override;
44
45
  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
46
0
  {
47
0
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
48
0
  }
49
50
  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
51
52
private:
53
  RefPtr<TextureClient> mTextureClient;
54
  RefPtr<ImageClient> mCompositable;
55
};
56
57
} // namespace layers
58
} // namespace mozilla
59
60
#endif