Bug 1632310 [wpt PR 23186] - Add test for computed versus resolved style., a=testonly
[gecko.git] / gfx / layers / wr / WebRenderDrawEventRecorder.h
blobb08ff5b959e96d3b6bdfbd6c0fea136f25e75c75
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"
13 namespace mozilla {
14 namespace layers {
16 struct BlobFont {
17 wr::FontInstanceKey mFontInstanceKey;
18 gfx::ReferencePtr mScaledFontPtr;
21 class WebRenderDrawEventRecorder final : public gfx::DrawEventRecorderMemory {
22 public:
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;
32 private:
33 virtual ~WebRenderDrawEventRecorder() = default;
36 class WebRenderTranslator final : public gfx::InlineTranslator {
37 public:
38 explicit WebRenderTranslator(gfx::DrawTarget* aDT,
39 void* aFontContext = nullptr)
40 : InlineTranslator(aDT, aFontContext) {}
42 already_AddRefed<gfx::SourceSurface> LookupExternalSurface(
43 uint64_t aKey) final;
46 } // namespace layers
47 } // namespace mozilla
49 #endif