gecko-dev/gfx/2d/SourceSurfaceCapture.h
Daniel Holbert 73cea96890 Bug 1435297 part 2: (automated patch) Switch a bunch of C++ files in gfx to use our standard emacs/vim mode lines. r=jrmuizel
This patch was generated automatically by the "modeline.py" script, available
here: https://github.com/amccreight/moz-source-tools/blob/master/modeline.py.
I ran it as follows:
  python /path/to/modeline.py --fix gfx/

This patch changes all affected files to use the exact C++ mode lines from the
Mozilla coding style guide, available here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Mode_Line

MozReview-Commit-ID: FsPNGjFkIFV

--HG--
extra : rebase_source : 7532d0478d0af75e346102105caf5b89631457aa
2018-02-02 12:07:36 -05:00

72 lines
2.2 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_gfx_2d_SourceSurfaceCapture_h
#define mozilla_gfx_2d_SourceSurfaceCapture_h
#include "2D.h"
#include "CaptureCommandList.h"
#include "mozilla/Mutex.h"
namespace mozilla {
namespace gfx {
class DrawTargetCaptureImpl;
class SourceSurfaceCapture : public SourceSurface
{
friend class DrawTargetCaptureImpl;
public:
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurfaceCapture, override)
explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner);
explicit SourceSurfaceCapture(DrawTargetCaptureImpl* aOwner,
LuminanceType aLuminanceType,
float aOpacity);
~SourceSurfaceCapture();
SurfaceType GetType() const override { return SurfaceType::CAPTURE; }
IntSize GetSize() const override { return mSize; }
SurfaceFormat GetFormat() const override { return mFormat; }
bool IsValid() const override;
already_AddRefed<DataSourceSurface> GetDataSurface() override;
// The backend hint is not guaranteed to be honored, so callers must check
// the resulting type if needed.
RefPtr<SourceSurface> Resolve(BackendType aBackendType = BackendType::NONE);
protected:
RefPtr<SourceSurface> ResolveImpl(BackendType aBackendType);
void DrawTargetWillDestroy();
void DrawTargetWillChange();
private:
IntSize mSize;
SurfaceFormat mFormat;
int32_t mStride;
int32_t mSurfaceAllocationSize;
RefPtr<DrawTarget> mRefDT;
DrawTargetCaptureImpl* mOwner;
CaptureCommandList mCommands;
bool mHasCommandList;
bool mShouldResolveToLuminance;
LuminanceType mLuminanceType;
float mOpacity;
// Note that we have to keep a reference around. Internal methods like
// GetSkImageForSurface expect their callers to hold a reference, which
// isn't easily possible for nested surfaces.
mutable Mutex mLock;
RefPtr<SourceSurface> mResolved;
};
} // namespace gfx
} // namespace mozilla
#endif // mozilla_gfx_2d_SourceSurfaceCapture_h