1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
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/. */
6 #ifndef MOZILLA_LAYERS_WEBRENDERDRAWTARGETRECORDER_H
7 #define MOZILLA_LAYERS_WEBRENDERDRAWTARGETRECORDER_H
9 #include "mozilla/gfx/DrawEventRecorder.h"
10 #include "mozilla/gfx/InlineTranslator.h"
11 #include "mozilla/webrender/webrender_ffi.h"
17 wr::FontInstanceKey mFontInstanceKey
;
18 gfx::ReferencePtr mScaledFontPtr
;
21 class WebRenderDrawEventRecorder final
: public gfx::DrawEventRecorderMemory
{
23 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebRenderDrawEventRecorder
, final
)
25 explicit WebRenderDrawEventRecorder(
26 const gfx::SerializeResourcesFn
& aSerialize
)
27 : DrawEventRecorderMemory(aSerialize
) {}
29 void StoreSourceSurfaceRecording(gfx::SourceSurface
* aSurface
,
30 const char* aReason
) final
;
33 virtual ~WebRenderDrawEventRecorder() = default;
36 class WebRenderTranslator final
: public gfx::InlineTranslator
{
38 explicit WebRenderTranslator(gfx::DrawTarget
* aDT
,
39 void* aFontContext
= nullptr)
40 : InlineTranslator(aDT
, aFontContext
) {}
42 already_AddRefed
<gfx::SourceSurface
> LookupExternalSurface(
47 } // namespace mozilla