2017-01-10 12:17:30 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 sts=2 ts=8 et tw=99 : */
|
|
|
|
/* 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_LAYERS_WEBRENDERAPI_H
|
|
|
|
#define MOZILLA_LAYERS_WEBRENDERAPI_H
|
|
|
|
|
2017-06-08 18:34:00 +03:00
|
|
|
#include <vector>
|
2017-06-16 22:12:24 +03:00
|
|
|
#include <unordered_map>
|
2017-06-08 18:34:00 +03:00
|
|
|
|
2017-01-10 12:17:30 +03:00
|
|
|
#include "mozilla/AlreadyAddRefed.h"
|
2017-01-13 13:25:07 +03:00
|
|
|
#include "mozilla/Range.h"
|
2017-01-17 03:22:01 +03:00
|
|
|
#include "mozilla/webrender/webrender_ffi.h"
|
2017-01-17 03:21:52 +03:00
|
|
|
#include "mozilla/webrender/WebRenderTypes.h"
|
2017-05-12 20:58:09 +03:00
|
|
|
#include "FrameMetrics.h"
|
2017-03-03 18:45:29 +03:00
|
|
|
#include "GLTypes.h"
|
2017-01-16 17:22:47 +03:00
|
|
|
#include "Units.h"
|
2017-01-10 12:17:30 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace widget {
|
|
|
|
class CompositorWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace layers {
|
2017-01-17 03:22:09 +03:00
|
|
|
class CompositorBridgeParentBase;
|
2017-06-02 02:07:59 +03:00
|
|
|
class WebRenderBridgeParent;
|
2017-01-17 03:22:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace wr {
|
2017-01-10 12:17:30 +03:00
|
|
|
|
2017-01-13 13:25:07 +03:00
|
|
|
class DisplayListBuilder;
|
2017-01-10 12:17:30 +03:00
|
|
|
class RendererOGL;
|
2017-01-17 22:46:31 +03:00
|
|
|
class RendererEvent;
|
2017-01-10 12:17:30 +03:00
|
|
|
|
|
|
|
class WebRenderAPI
|
|
|
|
{
|
2017-01-25 00:06:17 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(WebRenderAPI);
|
|
|
|
|
2017-01-10 12:17:30 +03:00
|
|
|
public:
|
2017-01-25 00:06:17 +03:00
|
|
|
/// This can be called on the compositor thread only.
|
2017-01-10 12:17:30 +03:00
|
|
|
static already_AddRefed<WebRenderAPI> Create(bool aEnableProfiler,
|
2017-01-17 03:22:09 +03:00
|
|
|
layers::CompositorBridgeParentBase* aBridge,
|
2017-03-07 02:46:30 +03:00
|
|
|
RefPtr<widget::CompositorWidget>&& aWidget,
|
|
|
|
LayoutDeviceIntSize aSize);
|
2017-01-10 12:17:30 +03:00
|
|
|
|
2017-01-17 03:22:09 +03:00
|
|
|
wr::WindowId GetId() const { return mId; }
|
2017-02-27 03:27:04 +03:00
|
|
|
|
2017-06-28 02:20:36 +03:00
|
|
|
void UpdateScrollPosition(const wr::WrPipelineId& aPipelineId,
|
2017-05-12 20:58:20 +03:00
|
|
|
const layers::FrameMetrics::ViewID& aScrollId,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutPoint& aScrollPosition);
|
2017-05-12 20:58:20 +03:00
|
|
|
|
2017-02-27 03:27:04 +03:00
|
|
|
void GenerateFrame();
|
2017-06-28 02:20:36 +03:00
|
|
|
void GenerateFrame(const nsTArray<wr::WrOpacityProperty>& aOpacityArray,
|
|
|
|
const nsTArray<wr::WrTransformProperty>& aTransformArray);
|
2017-01-10 12:17:30 +03:00
|
|
|
|
2017-03-07 01:41:51 +03:00
|
|
|
void SetWindowParameters(LayoutDeviceIntSize size);
|
2017-01-16 17:22:47 +03:00
|
|
|
void SetRootDisplayList(gfx::Color aBgColor,
|
2017-03-01 17:10:53 +03:00
|
|
|
Epoch aEpoch,
|
2017-01-16 17:22:47 +03:00
|
|
|
LayerSize aViewportSize,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrPipelineId pipeline_id,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutSize& content_size,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrBuiltDisplayListDescriptor dl_descriptor,
|
2017-03-01 17:10:53 +03:00
|
|
|
uint8_t *dl_data,
|
2017-05-08 20:52:16 +03:00
|
|
|
size_t dl_size);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-03-06 04:42:17 +03:00
|
|
|
void ClearRootDisplayList(Epoch aEpoch,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrPipelineId pipeline_id);
|
2017-03-06 04:42:17 +03:00
|
|
|
|
2017-01-17 03:22:09 +03:00
|
|
|
void SetRootPipeline(wr::PipelineId aPipeline);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-02-22 21:19:57 +03:00
|
|
|
void AddImage(wr::ImageKey aKey,
|
|
|
|
const ImageDescriptor& aDescriptor,
|
|
|
|
Range<uint8_t> aBytes);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-03-27 14:44:52 +03:00
|
|
|
void AddBlobImage(wr::ImageKey aKey,
|
|
|
|
const ImageDescriptor& aDescriptor,
|
|
|
|
Range<uint8_t> aBytes);
|
|
|
|
|
2017-03-02 04:22:40 +03:00
|
|
|
void AddExternalImageBuffer(ImageKey key,
|
2017-03-09 05:10:09 +03:00
|
|
|
const ImageDescriptor& aDescriptor,
|
2017-04-19 12:59:53 +03:00
|
|
|
ExternalImageId aHandle);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-05-18 17:59:07 +03:00
|
|
|
void AddExternalImage(ImageKey key,
|
|
|
|
const ImageDescriptor& aDescriptor,
|
|
|
|
ExternalImageId aExtID,
|
|
|
|
WrExternalImageBufferType aBufferType,
|
|
|
|
uint8_t aChannelIndex);
|
|
|
|
|
2017-01-17 03:22:09 +03:00
|
|
|
void UpdateImageBuffer(wr::ImageKey aKey,
|
2017-02-14 21:34:15 +03:00
|
|
|
const ImageDescriptor& aDescriptor,
|
2017-01-16 17:22:47 +03:00
|
|
|
Range<uint8_t> aBytes);
|
|
|
|
|
2017-01-17 03:22:09 +03:00
|
|
|
void DeleteImage(wr::ImageKey aKey);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-04-21 18:50:21 +03:00
|
|
|
void AddRawFont(wr::FontKey aKey, Range<uint8_t> aBytes, uint32_t aIndex);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-01-17 03:22:09 +03:00
|
|
|
void DeleteFont(wr::FontKey aKey);
|
2017-01-16 17:22:47 +03:00
|
|
|
|
|
|
|
void SetProfilerEnabled(bool aEnabled);
|
|
|
|
|
2017-01-28 00:08:17 +03:00
|
|
|
void RunOnRenderThread(UniquePtr<RendererEvent> aEvent);
|
2017-01-25 07:29:34 +03:00
|
|
|
void Readback(gfx::IntSize aSize, uint8_t *aBuffer, uint32_t aBufferSize);
|
2017-01-17 22:46:31 +03:00
|
|
|
|
2017-04-05 17:12:11 +03:00
|
|
|
void Pause();
|
|
|
|
bool Resume();
|
|
|
|
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrIdNamespace GetNamespace();
|
2017-01-18 22:50:00 +03:00
|
|
|
GLint GetMaxTextureSize() const { return mMaxTextureSize; }
|
2017-02-23 11:46:56 +03:00
|
|
|
bool GetUseANGLE() const { return mUseANGLE; }
|
2017-01-18 22:50:00 +03:00
|
|
|
|
2017-01-10 12:17:30 +03:00
|
|
|
protected:
|
2017-06-28 02:20:36 +03:00
|
|
|
WebRenderAPI(wr::WrAPI* aRawApi, wr::WindowId aId, GLint aMaxTextureSize, bool aUseANGLE)
|
2017-01-25 00:06:17 +03:00
|
|
|
: mWrApi(aRawApi)
|
|
|
|
, mId(aId)
|
|
|
|
, mMaxTextureSize(aMaxTextureSize)
|
2017-02-23 11:46:56 +03:00
|
|
|
, mUseANGLE(aUseANGLE)
|
2017-01-10 12:17:30 +03:00
|
|
|
{}
|
|
|
|
|
|
|
|
~WebRenderAPI();
|
2017-03-07 13:37:28 +03:00
|
|
|
// Should be used only for shutdown handling
|
|
|
|
void WaitFlushed();
|
2017-01-10 12:17:30 +03:00
|
|
|
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrAPI* mWrApi;
|
2017-01-17 03:22:09 +03:00
|
|
|
wr::WindowId mId;
|
2017-01-18 22:50:00 +03:00
|
|
|
GLint mMaxTextureSize;
|
2017-02-23 11:46:56 +03:00
|
|
|
bool mUseANGLE;
|
2017-01-11 15:51:27 +03:00
|
|
|
|
2017-01-13 13:25:07 +03:00
|
|
|
friend class DisplayListBuilder;
|
2017-06-02 02:07:59 +03:00
|
|
|
friend class layers::WebRenderBridgeParent;
|
2017-01-13 13:25:07 +03:00
|
|
|
};
|
|
|
|
|
2017-01-17 17:32:25 +03:00
|
|
|
/// This is a simple C++ wrapper around WrState defined in the rust bindings.
|
2017-01-13 13:25:07 +03:00
|
|
|
/// We may want to turn this into a direct wrapper on top of WebRenderFrameBuilder
|
|
|
|
/// instead, so the interface may change a bit.
|
|
|
|
class DisplayListBuilder {
|
|
|
|
public:
|
2017-05-15 22:13:31 +03:00
|
|
|
explicit DisplayListBuilder(wr::PipelineId aId,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutSize& aContentSize);
|
2017-01-13 13:25:07 +03:00
|
|
|
DisplayListBuilder(DisplayListBuilder&&) = default;
|
|
|
|
|
|
|
|
~DisplayListBuilder();
|
|
|
|
|
|
|
|
void Begin(const LayerIntSize& aSize);
|
|
|
|
|
2017-02-24 00:12:40 +03:00
|
|
|
void End();
|
2017-07-19 01:32:46 +03:00
|
|
|
void Finalize(wr::LayoutSize& aOutContentSize,
|
2017-05-15 22:13:31 +03:00
|
|
|
wr::BuiltDisplayList& aOutDisplayList);
|
2017-01-13 13:25:07 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushStackingContext(const wr::LayoutRect& aBounds, // TODO: We should work with strongly typed rects
|
2017-03-29 12:23:08 +03:00
|
|
|
const uint64_t& aAnimationId,
|
|
|
|
const float* aOpacity,
|
|
|
|
const gfx::Matrix4x4* aTransform,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrTransformStyle aTransformStyle,
|
|
|
|
const wr::WrMixBlendMode& aMixBlendMode,
|
|
|
|
const nsTArray<wr::WrFilterOp>& aFilters);
|
2017-01-13 13:25:07 +03:00
|
|
|
void PopStackingContext();
|
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushClip(const wr::LayoutRect& aClipRect,
|
2017-06-28 02:20:36 +03:00
|
|
|
const wr::WrImageMask* aMask);
|
2017-04-18 18:09:39 +03:00
|
|
|
void PopClip();
|
|
|
|
|
2017-06-22 01:39:21 +03:00
|
|
|
void PushBuiltDisplayList(wr::BuiltDisplayList &dl);
|
2017-03-03 18:45:29 +03:00
|
|
|
|
2017-05-12 20:58:09 +03:00
|
|
|
void PushScrollLayer(const layers::FrameMetrics::ViewID& aScrollId,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutRect& aContentRect, // TODO: We should work with strongly typed rects
|
|
|
|
const wr::LayoutRect& aClipRect);
|
2017-02-14 21:34:15 +03:00
|
|
|
void PopScrollLayer();
|
|
|
|
|
2017-06-08 18:34:01 +03:00
|
|
|
void PushClipAndScrollInfo(const layers::FrameMetrics::ViewID& aScrollId,
|
2017-06-28 02:20:36 +03:00
|
|
|
const wr::WrClipId* aClipId);
|
2017-06-08 18:34:01 +03:00
|
|
|
void PopClipAndScrollInfo();
|
2017-02-14 21:34:15 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushRect(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
|
|
|
const wr::ColorF& aColor);
|
2017-01-13 13:25:07 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushLinearGradient(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
|
|
|
const wr::LayoutPoint& aStartPoint,
|
|
|
|
const wr::LayoutPoint& aEndPoint,
|
2017-07-19 08:47:07 +03:00
|
|
|
const nsTArray<wr::GradientStop>& aStops,
|
|
|
|
wr::ExtendMode aExtendMode,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutSize aTileSize,
|
|
|
|
const wr::LayoutSize aTileSpacing);
|
2017-06-28 02:20:36 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushRadialGradient(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
|
|
|
const wr::LayoutPoint& aCenter,
|
|
|
|
const wr::LayoutSize& aRadius,
|
2017-07-19 08:47:07 +03:00
|
|
|
const nsTArray<wr::GradientStop>& aStops,
|
|
|
|
wr::ExtendMode aExtendMode,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutSize aTileSize,
|
|
|
|
const wr::LayoutSize aTileSpacing);
|
2017-02-17 03:51:32 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushImage(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-02-14 21:34:15 +03:00
|
|
|
wr::ImageRendering aFilter,
|
2017-01-17 22:48:00 +03:00
|
|
|
wr::ImageKey aImage);
|
2017-01-13 13:25:07 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushImage(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
|
|
|
const wr::LayoutSize& aStretchSize,
|
|
|
|
const wr::LayoutSize& aTileSpacing,
|
2017-04-07 09:53:16 +03:00
|
|
|
wr::ImageRendering aFilter,
|
|
|
|
wr::ImageKey aImage);
|
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushYCbCrPlanarImage(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-04-29 00:00:57 +03:00
|
|
|
wr::ImageKey aImageChannel0,
|
|
|
|
wr::ImageKey aImageChannel1,
|
|
|
|
wr::ImageKey aImageChannel2,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrYuvColorSpace aColorSpace,
|
2017-06-01 15:57:10 +03:00
|
|
|
wr::ImageRendering aFilter);
|
2017-04-29 00:00:57 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushNV12Image(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-04-29 00:00:57 +03:00
|
|
|
wr::ImageKey aImageChannel0,
|
|
|
|
wr::ImageKey aImageChannel1,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrYuvColorSpace aColorSpace,
|
2017-06-01 15:57:10 +03:00
|
|
|
wr::ImageRendering aFilter);
|
2017-04-29 00:00:57 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushYCbCrInterleavedImage(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-05-18 17:59:07 +03:00
|
|
|
wr::ImageKey aImageChannel0,
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrYuvColorSpace aColorSpace,
|
2017-06-01 15:57:10 +03:00
|
|
|
wr::ImageRendering aFilter);
|
2017-05-18 17:59:07 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushIFrame(const wr::LayoutRect& aBounds,
|
2017-01-17 03:22:09 +03:00
|
|
|
wr::PipelineId aPipeline);
|
2017-01-13 13:25:07 +03:00
|
|
|
|
2017-07-01 02:22:25 +03:00
|
|
|
// XXX WrBorderSides are passed with Range.
|
|
|
|
// It is just to bypass compiler bug. See Bug 1357734.
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushBorder(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::BorderWidths& aWidths,
|
|
|
|
const Range<const wr::BorderSide>& aSides,
|
|
|
|
const wr::BorderRadius& aRadius);
|
2017-06-28 02:20:36 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushBorderImage(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::BorderWidths& aWidths,
|
2017-03-13 06:46:03 +03:00
|
|
|
wr::ImageKey aImage,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::NinePatchDescriptor& aPatch,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::SideOffsets2D_f32& aOutset,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::RepeatMode& aRepeatHorizontal,
|
|
|
|
const wr::RepeatMode& aRepeatVertical);
|
2017-06-28 02:20:36 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushBorderGradient(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::BorderWidths& aWidths,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutPoint& aStartPoint,
|
|
|
|
const wr::LayoutPoint& aEndPoint,
|
2017-07-19 08:47:07 +03:00
|
|
|
const nsTArray<wr::GradientStop>& aStops,
|
|
|
|
wr::ExtendMode aExtendMode,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::SideOffsets2D_f32& aOutset);
|
2017-06-28 02:20:36 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushBorderRadialGradient(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-07-19 08:56:20 +03:00
|
|
|
const wr::BorderWidths& aWidths,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::LayoutPoint& aCenter,
|
|
|
|
const wr::LayoutSize& aRadius,
|
2017-07-19 08:47:07 +03:00
|
|
|
const nsTArray<wr::GradientStop>& aStops,
|
|
|
|
wr::ExtendMode aExtendMode,
|
2017-07-19 01:32:46 +03:00
|
|
|
const wr::SideOffsets2D_f32& aOutset);
|
2017-04-10 12:27:30 +03:00
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushText(const wr::LayoutRect& aBounds,
|
|
|
|
const wr::LayoutRect& aClip,
|
2017-01-13 13:25:07 +03:00
|
|
|
const gfx::Color& aColor,
|
2017-01-17 03:22:09 +03:00
|
|
|
wr::FontKey aFontKey,
|
2017-07-19 01:53:09 +03:00
|
|
|
Range<const wr::GlyphInstance> aGlyphBuffer,
|
2017-01-13 13:25:07 +03:00
|
|
|
float aGlyphSize);
|
|
|
|
|
2017-07-19 01:32:46 +03:00
|
|
|
void PushBoxShadow(const wr::LayoutRect& aRect,
|
|
|
|
const wr::LayoutRect& aClip,
|
|
|
|
const wr::LayoutRect& aBoxBounds,
|
|
|
|
const wr::LayoutVector2D& aOffset,
|
|
|
|
const wr::ColorF& aColor,
|
2017-02-16 21:23:22 +03:00
|
|
|
const float& aBlurRadius,
|
|
|
|
const float& aSpreadRadius,
|
|
|
|
const float& aBorderRadius,
|
2017-06-28 02:20:36 +03:00
|
|
|
const wr::WrBoxShadowClipMode& aClipMode);
|
2017-02-16 21:23:22 +03:00
|
|
|
|
2017-06-08 18:34:00 +03:00
|
|
|
// Returns the clip id that was most recently pushed with PushClip and that
|
|
|
|
// has not yet been popped with PopClip. Return Nothing() if the clip stack
|
|
|
|
// is empty.
|
2017-06-28 02:20:36 +03:00
|
|
|
Maybe<wr::WrClipId> TopmostClipId();
|
2017-06-16 22:12:24 +03:00
|
|
|
// Returns the scroll id that was pushed just before the given scroll id. This
|
|
|
|
// function returns Nothing() if the given scrollid has not been encountered,
|
|
|
|
// or if it is the rootmost scroll id (and therefore has no ancestor).
|
2017-06-08 18:34:00 +03:00
|
|
|
Maybe<layers::FrameMetrics::ViewID> ParentScrollIdFor(layers::FrameMetrics::ViewID aScrollId);
|
|
|
|
|
2017-01-13 13:25:07 +03:00
|
|
|
// Try to avoid using this when possible.
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrState* Raw() { return mWrState; }
|
2017-01-13 13:25:07 +03:00
|
|
|
protected:
|
2017-06-28 02:20:36 +03:00
|
|
|
wr::WrState* mWrState;
|
2017-01-16 17:22:47 +03:00
|
|
|
|
2017-06-08 18:34:00 +03:00
|
|
|
// Track the stack of clip ids and scroll layer ids that have been pushed
|
|
|
|
// (by PushClip and PushScrollLayer, respectively) and are still active.
|
|
|
|
// This is helpful for knowing e.g. what the ancestor scroll id of a particular
|
|
|
|
// scroll id is, and doing other "queries" of current state.
|
2017-06-28 02:20:36 +03:00
|
|
|
std::vector<wr::WrClipId> mClipIdStack;
|
2017-06-08 18:34:00 +03:00
|
|
|
std::vector<layers::FrameMetrics::ViewID> mScrollIdStack;
|
|
|
|
|
2017-06-16 22:12:24 +03:00
|
|
|
// Track the parent scroll id of each scroll id that we encountered.
|
|
|
|
std::unordered_map<layers::FrameMetrics::ViewID, layers::FrameMetrics::ViewID> mScrollParents;
|
|
|
|
|
2017-01-16 17:22:47 +03:00
|
|
|
friend class WebRenderAPI;
|
2017-01-10 12:17:30 +03:00
|
|
|
};
|
|
|
|
|
2017-06-28 02:20:36 +03:00
|
|
|
Maybe<wr::WrImageFormat>
|
2017-01-17 23:13:41 +03:00
|
|
|
SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat);
|
|
|
|
|
2017-01-25 00:06:17 +03:00
|
|
|
} // namespace wr
|
|
|
|
} // namespace mozilla
|
2017-01-10 12:17:30 +03:00
|
|
|
|
2017-01-24 16:44:23 +03:00
|
|
|
#endif
|