Bug 1382128 part 8 - Remove Wr prefix from some type aliases. r=kats

MozReview-Commit-ID: 5h7QobhcYc1

--HG--
extra : rebase_source : 34d6636b6c3726ccc21b105f05227e27f84e63c9
This commit is contained in:
Ryan Hunt 2017-07-19 03:28:58 -04:00
Родитель e06d502736
Коммит 522bc76415
22 изменённых файлов: 259 добавлений и 271 удалений

Просмотреть файл

@ -23,7 +23,7 @@ using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ImageKey from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::FontKey from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::PipelineId from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::WrBuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::BuiltDisplayListDescriptor from "mozilla/webrender/webrender_ffi.h";
using mozilla::layers::WebRenderScrollData from "mozilla/layers/WebRenderScrollData.h";
namespace mozilla {
@ -55,10 +55,10 @@ parent:
async DeleteFont(FontKey aFontKey);
async DPBegin(IntSize aSize);
async DPEnd(IntSize aSize, WebRenderParentCommand[] commands, OpDestroy[] toDestroy, uint64_t fwdTransactionId, uint64_t transactionId,
LayoutSize aContentSize, ByteBuffer aDL, WrBuiltDisplayListDescriptor aDLDesc,
LayoutSize aContentSize, ByteBuffer aDL, BuiltDisplayListDescriptor aDLDesc,
WebRenderScrollData aScrollData, uint32_t idNameSpace);
sync DPSyncEnd(IntSize aSize, WebRenderParentCommand[] commands, OpDestroy[] toDestroy, uint64_t fwdTransactionId, uint64_t transactionId,
LayoutSize aContentSize, ByteBuffer aDL, WrBuiltDisplayListDescriptor aDLDesc,
LayoutSize aContentSize, ByteBuffer aDL, BuiltDisplayListDescriptor aDLDesc,
WebRenderScrollData aScrollData, uint32_t idNameSpace);
async ParentCommands(WebRenderParentCommand[] commands);
sync DPGetSnapshot(PTexture texture);

Просмотреть файл

@ -10,8 +10,8 @@ include LayersMessages;
include protocol PTexture;
using mozilla::wr::LayoutSize from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::WrImageRendering from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::WrMixBlendMode from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::ImageRendering from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::MixBlendMode from "mozilla/webrender/webrender_ffi.h";
using mozilla::wr::MaybeImageMask from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ExternalImageId from "mozilla/webrender/WebRenderTypes.h";
using mozilla::wr::ImageKey from "mozilla/webrender/WebRenderTypes.h";
@ -51,8 +51,8 @@ struct OpUpdateAsyncImagePipeline {
LayerRect scBounds;
Matrix4x4 scTransform;
MaybeIntSize scaleToSize;
WrImageRendering filter;
WrMixBlendMode mixBlendMode;
ImageRendering filter;
MixBlendMode mixBlendMode;
};
union WebRenderParentCommand {

Просмотреть файл

@ -36,9 +36,9 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aAnimationsId,
aOpacityPtr,
aTransformPtr,
wr::WrTransformStyle::Flat,
wr::TransformStyle::Flat,
// TODO: set correct blend mode.
wr::ToWrMixBlendMode(gfx::CompositionOp::OP_OVER),
wr::ToMixBlendMode(gfx::CompositionOp::OP_OVER),
aFilters);
mOrigin = aOrigin;
@ -58,8 +58,8 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
float opacity = 1.0f;
mBuilder->PushStackingContext(scBounds, 0, &opacity,
mTransform.IsIdentity() ? nullptr : &mTransform,
wr::WrTransformStyle::Flat,
wr::ToWrMixBlendMode(layer->GetMixBlendMode()),
wr::TransformStyle::Flat,
wr::ToMixBlendMode(layer->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
}
@ -82,8 +82,8 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aAnimationsId,
aOpacityPtr,
aTransformPtr,
wr::WrTransformStyle::Flat,
wr::ToWrMixBlendMode(aLayer->GetLayer()->GetMixBlendMode()),
wr::TransformStyle::Flat,
wr::ToMixBlendMode(aLayer->GetLayer()->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
}

Просмотреть файл

@ -402,7 +402,7 @@ WebRenderBridgeParent::HandleDPEnd(const gfx::IntSize& aSize,
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -515,7 +515,7 @@ WebRenderBridgeParent::RecvDPEnd(const gfx::IntSize& aSize,
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -535,7 +535,7 @@ WebRenderBridgeParent::RecvDPSyncEnd(const gfx::IntSize &aSize,
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace)
{
@ -657,7 +657,7 @@ void
WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
InfallibleTArray<WebRenderParentCommand>& aCommands, const wr::Epoch& aEpoch,
const wr::LayoutSize& aContentSize, const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const uint32_t& aIdNameSpace)
{
mCompositableHolder->SetCompositionTime(TimeStamp::Now());

Просмотреть файл

@ -100,7 +100,7 @@ public:
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace) override;
mozilla::ipc::IPCResult RecvDPSyncEnd(const gfx::IntSize& aSize,
@ -110,7 +110,7 @@ public:
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace) override;
mozilla::ipc::IPCResult RecvParentCommands(nsTArray<WebRenderParentCommand>&& commands) override;
@ -219,7 +219,7 @@ private:
const wr::Epoch& aEpoch,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const uint32_t& aIdNameSpace);
void ClearResources();
uint64_t GetChildLayerObserverEpoch() const { return mChildLayerObserverEpoch; }
@ -231,7 +231,7 @@ private:
const uint64_t& aTransactionId,
const wr::LayoutSize& aContentSize,
const wr::ByteBuffer& dl,
const wr::WrBuiltDisplayListDescriptor& dlDesc,
const wr::BuiltDisplayListDescriptor& dlDesc,
const WebRenderScrollData& aScrollData,
const uint32_t& aIdNameSpace);
mozilla::ipc::IPCResult HandleShutdown();

Просмотреть файл

@ -19,8 +19,8 @@ WebRenderCompositableHolder::AsyncImagePipelineHolder::AsyncImagePipelineHolder(
: mInitialised(false)
, mIsChanged(false)
, mUseExternalImage(false)
, mFilter(wr::WrImageRendering::Auto)
, mMixBlendMode(wr::WrMixBlendMode::Normal)
, mFilter(wr::ImageRendering::Auto)
, mMixBlendMode(wr::MixBlendMode::Normal)
{}
WebRenderCompositableHolder::WebRenderCompositableHolder(uint32_t aIdNamespace)
@ -135,8 +135,8 @@ WebRenderCompositableHolder::UpdateAsyncImagePipeline(const wr::PipelineId& aPip
const LayerRect& aScBounds,
const gfx::Matrix4x4& aScTransform,
const gfx::MaybeIntSize& aScaleToSize,
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode)
const wr::ImageRendering& aFilter,
const wr::MixBlendMode& aMixBlendMode)
{
if (mDestroyed) {
return;
@ -275,7 +275,7 @@ WebRenderCompositableHolder::ApplyAsyncImages(wr::WebRenderAPI* aApi)
0,
&opacity,
holder->mScTransform.IsIdentity() ? nullptr : &holder->mScTransform,
wr::WrTransformStyle::Flat,
wr::TransformStyle::Flat,
holder->mMixBlendMode,
nsTArray<wr::WrFilterOp>());

Просмотреть файл

@ -75,8 +75,8 @@ public:
const LayerRect& aScBounds,
const gfx::Matrix4x4& aScTransform,
const gfx::MaybeIntSize& aScaleToSize,
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode);
const wr::ImageRendering& aFilter,
const wr::MixBlendMode& aMixBlendMode);
void ApplyAsyncImages(wr::WebRenderAPI* aApi);
private:
@ -117,8 +117,8 @@ private:
LayerRect mScBounds;
gfx::Matrix4x4 mScTransform;
gfx::MaybeIntSize mScaleToSize;
wr::WrImageRendering mFilter;
wr::WrMixBlendMode mMixBlendMode;
wr::ImageRendering mFilter;
wr::MixBlendMode mMixBlendMode;
RefPtr<WebRenderImageHost> mImageHost;
CompositableTextureHostRef mCurrentTexture;
nsTArray<wr::ImageKey> mKeys;

Просмотреть файл

@ -185,7 +185,7 @@ WebRenderImageLayer::RenderLayer(wr::DisplayListBuilder& aBuilder,
}
LayerRect scBounds = BoundsForStackingContext();
wr::ImageRendering filter = wr::ToImageRendering(mSamplingFilter);
wr::MixBlendMode mixBlendMode = wr::ToWrMixBlendMode(GetMixBlendMode());
wr::MixBlendMode mixBlendMode = wr::ToMixBlendMode(GetMixBlendMode());
WrBridge()->AddWebRenderParentCommand(OpUpdateAsyncImagePipeline(mPipelineId.value(),
scBounds,

Просмотреть файл

@ -126,7 +126,7 @@ WebRenderLayer::DumpLayerInfo(const char* aLayerType, const LayerRect& aRect)
Layer* layer = GetLayer();
Matrix4x4 transform = layer->GetTransform();
LayerRect bounds = Bounds();
wr::WrMixBlendMode mixBlendMode = wr::ToWrMixBlendMode(GetLayer()->GetMixBlendMode());
wr::MixBlendMode mixBlendMode = wr::ToMixBlendMode(GetLayer()->GetMixBlendMode());
printf_stderr("%s %p using bounds=%s, transform=%s, rect=%s, clip=%s, mix-blend-mode=%s\n",
aLayerType,

Просмотреть файл

@ -106,11 +106,11 @@ struct ParamTraits<mozilla::wr::PipelineId>
};
template<>
struct ParamTraits<mozilla::wr::WrImageFormat>
struct ParamTraits<mozilla::wr::ImageFormat>
: public ContiguousEnumSerializer<
mozilla::wr::WrImageFormat,
mozilla::wr::WrImageFormat::Invalid,
mozilla::wr::WrImageFormat::Sentinel>
mozilla::wr::ImageFormat,
mozilla::wr::ImageFormat::Invalid,
mozilla::wr::ImageFormat::Sentinel>
{
};
@ -193,35 +193,35 @@ struct ParamTraits<mozilla::wr::WrImageMask>
};
template<>
struct ParamTraits<mozilla::wr::WrImageRendering>
struct ParamTraits<mozilla::wr::ImageRendering>
: public ContiguousEnumSerializer<
mozilla::wr::WrImageRendering,
mozilla::wr::WrImageRendering::Auto,
mozilla::wr::WrImageRendering::Sentinel>
mozilla::wr::ImageRendering,
mozilla::wr::ImageRendering::Auto,
mozilla::wr::ImageRendering::Sentinel>
{
};
template<>
struct ParamTraits<mozilla::wr::WrMixBlendMode>
struct ParamTraits<mozilla::wr::MixBlendMode>
: public ContiguousEnumSerializer<
mozilla::wr::WrMixBlendMode,
mozilla::wr::WrMixBlendMode::Normal,
mozilla::wr::WrMixBlendMode::Sentinel>
mozilla::wr::MixBlendMode,
mozilla::wr::MixBlendMode::Normal,
mozilla::wr::MixBlendMode::Sentinel>
{
};
template<>
struct ParamTraits<mozilla::wr::WrBuiltDisplayListDescriptor>
struct ParamTraits<mozilla::wr::BuiltDisplayListDescriptor>
{
static void
Write(Message* aMsg, const mozilla::wr::WrBuiltDisplayListDescriptor& aParam)
Write(Message* aMsg, const mozilla::wr::BuiltDisplayListDescriptor& aParam)
{
WriteParam(aMsg, aParam.builder_start_time);
WriteParam(aMsg, aParam.builder_finish_time);
}
static bool
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::WrBuiltDisplayListDescriptor* aResult)
Read(const Message* aMsg, PickleIterator* aIter, mozilla::wr::BuiltDisplayListDescriptor* aResult)
{
return ReadParam(aMsg, aIter, &aResult->builder_start_time)
&& ReadParam(aMsg, aIter, &aResult->builder_finish_time);

Просмотреть файл

@ -93,8 +93,8 @@ WebRenderImageData::CreateAsyncImageWebRenderCommands(mozilla::wr::DisplayListBu
const LayerRect& aSCBounds,
const Matrix4x4& aSCTransform,
const MaybeIntSize& aScaleToSize,
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode)
const wr::ImageRendering& aFilter,
const wr::MixBlendMode& aMixBlendMode)
{
MOZ_ASSERT(aContainer->IsAsync());
if (!mPipelineId) {

Просмотреть файл

@ -67,8 +67,8 @@ public:
const LayerRect& aSCBounds,
const gfx::Matrix4x4& aSCTransform,
const gfx::MaybeIntSize& aScaleToSize,
const wr::WrImageRendering& aFilter,
const wr::WrMixBlendMode& aMixBlendMode);
const wr::ImageRendering& aFilter,
const wr::MixBlendMode& aMixBlendMode);
void CreateImageClientIfNeeded();

Просмотреть файл

@ -97,7 +97,7 @@ bool wr_moz2d_render_cb(const mozilla::wr::ByteSlice blob,
{
return mozilla::wr::Moz2DRenderCallback(mozilla::wr::ByteSliceToRange(blob),
mozilla::gfx::IntSize(width, height),
mozilla::wr::WrImageFormatToSurfaceFormat(aFormat),
mozilla::wr::ImageFormatToSurfaceFormat(aFormat),
mozilla::wr::MutByteSliceToRange(output));
}

Просмотреть файл

@ -56,19 +56,19 @@ RendererOGL::RendererOGL(RefPtr<RenderThread>&& aThread,
RefPtr<gl::GLContext>&& aGL,
RefPtr<widget::CompositorWidget>&& aWidget,
wr::WindowId aWindowId,
wr::WrRenderer* aWrRenderer,
wr::Renderer* aRenderer,
layers::CompositorBridgeParentBase* aBridge)
: mThread(aThread)
, mGL(aGL)
, mWidget(aWidget)
, mWrRenderer(aWrRenderer)
, mRenderer(aRenderer)
, mBridge(aBridge)
, mWindowId(aWindowId)
{
MOZ_ASSERT(mThread);
MOZ_ASSERT(mGL);
MOZ_ASSERT(mWidget);
MOZ_ASSERT(mWrRenderer);
MOZ_ASSERT(mRenderer);
MOZ_ASSERT(mBridge);
MOZ_COUNT_CTOR(RendererOGL);
}
@ -81,7 +81,7 @@ RendererOGL::~RendererOGL()
// Leak resources!
return;
}
wr_renderer_delete(mWrRenderer);
wr_renderer_delete(mRenderer);
}
wr::WrExternalImageHandler
@ -97,7 +97,7 @@ RendererOGL::GetExternalImageHandler()
void
RendererOGL::Update()
{
wr_renderer_update(mWrRenderer);
wr_renderer_update(mRenderer);
}
bool
@ -127,7 +127,7 @@ RendererOGL::Render()
// XXX set clear color if MOZ_WIDGET_ANDROID is defined.
auto size = mWidget->GetClientSize();
wr_renderer_render(mWrRenderer, size.width, size.height);
wr_renderer_render(mRenderer, size.width, size.height);
mGL->SwapBuffers();
mWidget->PostRender(&widgetContext);
@ -167,13 +167,13 @@ RendererOGL::Resume()
void
RendererOGL::SetProfilerEnabled(bool aEnabled)
{
wr_renderer_set_profiler_enabled(mWrRenderer, aEnabled);
wr_renderer_set_profiler_enabled(mRenderer, aEnabled);
}
wr::WrRenderedEpochs*
RendererOGL::FlushRenderedEpochs()
{
return wr_renderer_flush_rendered_epochs(mWrRenderer);
return wr_renderer_flush_rendered_epochs(mRenderer);
}
RenderTextureHost*

Просмотреть файл

@ -66,7 +66,7 @@ public:
RefPtr<gl::GLContext>&& aGL,
RefPtr<widget::CompositorWidget>&&,
wr::WindowId aWindowId,
wr::WrRenderer* aWrRenderer,
wr::Renderer* aRenderer,
layers::CompositorBridgeParentBase* aBridge);
/// This can be called on the render thread only.
@ -81,14 +81,14 @@ public:
RenderTextureHost* GetRenderTexture(wr::WrExternalImageId aExternalImageId);
wr::WrRenderer* GetWrRenderer() { return mWrRenderer; }
wr::Renderer* GetRenderer() { return mRenderer; }
protected:
RefPtr<RenderThread> mThread;
RefPtr<gl::GLContext> mGL;
RefPtr<widget::CompositorWidget> mWidget;
wr::WrRenderer* mWrRenderer;
wr::Renderer* mRenderer;
layers::CompositorBridgeParentBase* mBridge;
wr::WindowId mWindowId;
};

Просмотреть файл

@ -23,14 +23,14 @@ using layers::Stringify;
class NewRenderer : public RendererEvent
{
public:
NewRenderer(wr::WrAPI** aApi, layers::CompositorBridgeParentBase* aBridge,
NewRenderer(wr::RenderApi** aApi, layers::CompositorBridgeParentBase* aBridge,
GLint* aMaxTextureSize,
bool* aUseANGLE,
RefPtr<widget::CompositorWidget>&& aWidget,
layers::SynchronousTask* aTask,
bool aEnableProfiler,
LayoutDeviceIntSize aSize)
: mWrApi(aApi)
: mRenderApi(aApi)
, mMaxTextureSize(aMaxTextureSize)
, mUseANGLE(aUseANGLE)
, mBridge(aBridge)
@ -70,10 +70,10 @@ public:
gl->fGetIntegerv(LOCAL_GL_MAX_TEXTURE_SIZE, mMaxTextureSize);
*mUseANGLE = gl->IsANGLE();
wr::WrRenderer* wrRenderer = nullptr;
wr::Renderer* wrRenderer = nullptr;
if (!wr_window_new(aWindowId, mSize.width, mSize.height, gl.get(),
aRenderThread.ThreadPool().Raw(),
this->mEnableProfiler, mWrApi, &wrRenderer)) {
this->mEnableProfiler, mRenderApi, &wrRenderer)) {
// wr_window_new puts a message into gfxCriticalNote if it returns false
return;
}
@ -95,7 +95,7 @@ public:
}
private:
wr::WrAPI** mWrApi;
wr::RenderApi** mRenderApi;
GLint* mMaxTextureSize;
bool* mUseANGLE;
layers::CompositorBridgeParentBase* mBridge;
@ -143,30 +143,30 @@ WebRenderAPI::Create(bool aEnableProfiler,
static uint64_t sNextId = 1;
auto id = NewWindowId(sNextId++);
wr::WrAPI* wrApi = nullptr;
wr::RenderApi* renderApi = nullptr;
GLint maxTextureSize = 0;
bool useANGLE = false;
// Dispatch a synchronous task because the WrApi object needs to be created
// Dispatch a synchronous task because the RenderApi object needs to be created
// on the render thread. If need be we could delay waiting on this task until
// the next time we need to access the WrApi object.
// the next time we need to access the RenderApi object.
layers::SynchronousTask task("Create Renderer");
auto event = MakeUnique<NewRenderer>(&wrApi, aBridge, &maxTextureSize, &useANGLE,
auto event = MakeUnique<NewRenderer>(&renderApi, aBridge, &maxTextureSize, &useANGLE,
Move(aWidget), &task, aEnableProfiler, aSize);
RenderThread::Get()->RunEvent(id, Move(event));
task.Wait();
if (!wrApi) {
if (!renderApi) {
return nullptr;
}
return RefPtr<WebRenderAPI>(new WebRenderAPI(wrApi, id, maxTextureSize, useANGLE)).forget();
return RefPtr<WebRenderAPI>(new WebRenderAPI(renderApi, id, maxTextureSize, useANGLE)).forget();
}
wr::WrIdNamespace
WebRenderAPI::GetNamespace() {
return wr_api_get_namespace(mWrApi);
return wr_api_get_namespace(mRenderApi);
}
WebRenderAPI::~WebRenderAPI()
@ -176,7 +176,7 @@ WebRenderAPI::~WebRenderAPI()
RunOnRenderThread(Move(event));
task.Wait();
wr_api_delete(mWrApi);
wr_api_delete(mRenderApi);
}
void
@ -184,20 +184,20 @@ WebRenderAPI::UpdateScrollPosition(const wr::WrPipelineId& aPipelineId,
const layers::FrameMetrics::ViewID& aScrollId,
const wr::LayoutPoint& aScrollPosition)
{
wr_scroll_layer_with_id(mWrApi, aPipelineId, aScrollId, aScrollPosition);
wr_scroll_layer_with_id(mRenderApi, aPipelineId, aScrollId, aScrollPosition);
}
void
WebRenderAPI::GenerateFrame()
{
wr_api_generate_frame(mWrApi);
wr_api_generate_frame(mRenderApi);
}
void
WebRenderAPI::GenerateFrame(const nsTArray<wr::WrOpacityProperty>& aOpacityArray,
const nsTArray<wr::WrTransformProperty>& aTransformArray)
{
wr_api_generate_frame_with_properties(mWrApi,
wr_api_generate_frame_with_properties(mRenderApi,
aOpacityArray.IsEmpty() ?
nullptr : aOpacityArray.Elements(),
aOpacityArray.Length(),
@ -212,11 +212,11 @@ WebRenderAPI::SetRootDisplayList(gfx::Color aBgColor,
LayerSize aViewportSize,
wr::WrPipelineId pipeline_id,
const LayoutSize& content_size,
wr::WrBuiltDisplayListDescriptor dl_descriptor,
wr::BuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size)
{
wr_api_set_root_display_list(mWrApi,
wr_api_set_root_display_list(mRenderApi,
ToColorF(aBgColor),
aEpoch,
aViewportSize.width, aViewportSize.height,
@ -231,13 +231,13 @@ void
WebRenderAPI::ClearRootDisplayList(Epoch aEpoch,
wr::WrPipelineId pipeline_id)
{
wr_api_clear_root_display_list(mWrApi, aEpoch, pipeline_id);
wr_api_clear_root_display_list(mRenderApi, aEpoch, pipeline_id);
}
void
WebRenderAPI::SetWindowParameters(LayoutDeviceIntSize size)
{
wr_api_set_window_parameters(mWrApi, size.width, size.height);
wr_api_set_window_parameters(mRenderApi, size.width, size.height);
}
void
@ -266,7 +266,7 @@ WebRenderAPI::Readback(gfx::IntSize size,
virtual void Run(RenderThread& aRenderThread, WindowId aWindowId) override
{
aRenderThread.UpdateAndRender(aWindowId);
wr_renderer_readback(aRenderThread.GetRenderer(aWindowId)->GetWrRenderer(),
wr_renderer_readback(aRenderThread.GetRenderer(aWindowId)->GetRenderer(),
mSize.width, mSize.height, mBuffer, mBufferSize);
layers::AutoCompleteTask complete(mTask);
}
@ -399,14 +399,14 @@ WebRenderAPI::WaitFlushed()
void
WebRenderAPI::SetRootPipeline(PipelineId aPipeline)
{
wr_api_set_root_pipeline(mWrApi, aPipeline);
wr_api_set_root_pipeline(mRenderApi, aPipeline);
}
void
WebRenderAPI::AddImage(ImageKey key, const ImageDescriptor& aDescriptor,
Range<uint8_t> aBytes)
{
wr_api_add_image(mWrApi,
wr_api_add_image(mRenderApi,
key,
&aDescriptor,
RangeToByteSlice(aBytes));
@ -416,7 +416,7 @@ void
WebRenderAPI::AddBlobImage(ImageKey key, const ImageDescriptor& aDescriptor,
Range<uint8_t> aBytes)
{
wr_api_add_blob_image(mWrApi,
wr_api_add_blob_image(mRenderApi,
key,
&aDescriptor,
RangeToByteSlice(aBytes));
@ -429,7 +429,7 @@ WebRenderAPI::AddExternalImage(ImageKey key,
wr::WrExternalImageBufferType aBufferType,
uint8_t aChannelIndex)
{
wr_api_add_external_image(mWrApi,
wr_api_add_external_image(mRenderApi,
key,
&aDescriptor,
aExtID,
@ -442,7 +442,7 @@ WebRenderAPI::AddExternalImageBuffer(ImageKey key,
const ImageDescriptor& aDescriptor,
ExternalImageId aHandle)
{
wr_api_add_external_image_buffer(mWrApi,
wr_api_add_external_image_buffer(mRenderApi,
key,
&aDescriptor,
aHandle);
@ -453,7 +453,7 @@ WebRenderAPI::UpdateImageBuffer(ImageKey aKey,
const ImageDescriptor& aDescriptor,
Range<uint8_t> aBytes)
{
wr_api_update_image(mWrApi,
wr_api_update_image(mRenderApi,
aKey,
&aDescriptor,
RangeToByteSlice(aBytes));
@ -462,19 +462,19 @@ WebRenderAPI::UpdateImageBuffer(ImageKey aKey,
void
WebRenderAPI::DeleteImage(ImageKey aKey)
{
wr_api_delete_image(mWrApi, aKey);
wr_api_delete_image(mRenderApi, aKey);
}
void
WebRenderAPI::AddRawFont(wr::FontKey aKey, Range<uint8_t> aBytes, uint32_t aIndex)
{
wr_api_add_raw_font(mWrApi, aKey, &aBytes[0], aBytes.length(), aIndex);
wr_api_add_raw_font(mRenderApi, aKey, &aBytes[0], aBytes.length(), aIndex);
}
void
WebRenderAPI::DeleteFont(wr::FontKey aKey)
{
wr_api_delete_font(mWrApi, aKey);
wr_api_delete_font(mRenderApi, aKey);
}
class EnableProfiler : public RendererEvent
@ -514,7 +514,7 @@ void
WebRenderAPI::RunOnRenderThread(UniquePtr<RendererEvent> aEvent)
{
auto event = reinterpret_cast<uintptr_t>(aEvent.release());
wr_api_send_external_event(mWrApi, event);
wr_api_send_external_event(mRenderApi, event);
}
DisplayListBuilder::DisplayListBuilder(PipelineId aId,
@ -557,8 +557,8 @@ DisplayListBuilder::PushStackingContext(const wr::LayoutRect& aBounds,
const uint64_t& aAnimationId,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
wr::WrTransformStyle aTransformStyle,
const wr::WrMixBlendMode& aMixBlendMode,
wr::TransformStyle aTransformStyle,
const wr::MixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters)
{
wr::LayoutTransform matrix;
@ -868,7 +868,7 @@ DisplayListBuilder::PushBoxShadow(const wr::LayoutRect& aRect,
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const wr::WrBoxShadowClipMode& aClipMode)
const wr::BoxShadowClipMode& aClipMode)
{
wr_dp_push_box_shadow(mWrState, aRect, aClip,
aBoxBounds, aOffset, aColor,

Просмотреть файл

@ -62,7 +62,7 @@ public:
LayerSize aViewportSize,
wr::WrPipelineId pipeline_id,
const wr::LayoutSize& content_size,
wr::WrBuiltDisplayListDescriptor dl_descriptor,
wr::BuiltDisplayListDescriptor dl_descriptor,
uint8_t *dl_data,
size_t dl_size);
@ -112,8 +112,8 @@ public:
bool GetUseANGLE() const { return mUseANGLE; }
protected:
WebRenderAPI(wr::WrAPI* aRawApi, wr::WindowId aId, GLint aMaxTextureSize, bool aUseANGLE)
: mWrApi(aRawApi)
WebRenderAPI(wr::RenderApi* aRawApi, wr::WindowId aId, GLint aMaxTextureSize, bool aUseANGLE)
: mRenderApi(aRawApi)
, mId(aId)
, mMaxTextureSize(aMaxTextureSize)
, mUseANGLE(aUseANGLE)
@ -123,7 +123,7 @@ protected:
// Should be used only for shutdown handling
void WaitFlushed();
wr::WrAPI* mWrApi;
wr::RenderApi* mRenderApi;
wr::WindowId mId;
GLint mMaxTextureSize;
bool mUseANGLE;
@ -153,8 +153,8 @@ public:
const uint64_t& aAnimationId,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
wr::WrTransformStyle aTransformStyle,
const wr::WrMixBlendMode& aMixBlendMode,
wr::TransformStyle aTransformStyle,
const wr::MixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters);
void PopStackingContext();
@ -281,7 +281,7 @@ public:
const float& aBlurRadius,
const float& aSpreadRadius,
const float& aBorderRadius,
const wr::WrBoxShadowClipMode& aClipMode);
const wr::BoxShadowClipMode& aClipMode);
// 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
@ -310,8 +310,8 @@ protected:
friend class WebRenderAPI;
};
Maybe<wr::WrImageFormat>
SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat);
Maybe<wr::ImageFormat>
SurfaceFormatToImageFormat(gfx::SurfaceFormat aFormat);
} // namespace wr
} // namespace mozilla

Просмотреть файл

@ -20,9 +20,6 @@
namespace mozilla {
namespace wr {
typedef wr::WrMixBlendMode MixBlendMode;
typedef wr::WrImageRendering ImageRendering;
typedef wr::WrImageFormat ImageFormat;
typedef wr::WrWindowId WindowId;
typedef wr::WrPipelineId PipelineId;
typedef wr::WrImageKey ImageKey;
@ -45,32 +42,32 @@ inline Epoch NewEpoch(uint32_t aEpoch) {
return e;
}
inline Maybe<wr::WrImageFormat>
SurfaceFormatToWrImageFormat(gfx::SurfaceFormat aFormat) {
inline Maybe<wr::ImageFormat>
SurfaceFormatToImageFormat(gfx::SurfaceFormat aFormat) {
switch (aFormat) {
case gfx::SurfaceFormat::R8G8B8X8:
// TODO: use RGBA + opaque flag
return Some(wr::WrImageFormat::BGRA8);
return Some(wr::ImageFormat::BGRA8);
case gfx::SurfaceFormat::B8G8R8X8:
// TODO: WebRender will have a BGRA + opaque flag for this but does not
// have it yet (cf. issue #732).
case gfx::SurfaceFormat::B8G8R8A8:
return Some(wr::WrImageFormat::BGRA8);
return Some(wr::ImageFormat::BGRA8);
case gfx::SurfaceFormat::B8G8R8:
return Some(wr::WrImageFormat::RGB8);
return Some(wr::ImageFormat::RGB8);
case gfx::SurfaceFormat::A8:
return Some(wr::WrImageFormat::A8);
return Some(wr::ImageFormat::A8);
case gfx::SurfaceFormat::R8G8:
return Some(wr::WrImageFormat::RG8);
return Some(wr::ImageFormat::RG8);
case gfx::SurfaceFormat::UNKNOWN:
return Some(wr::WrImageFormat::Invalid);
return Some(wr::ImageFormat::Invalid);
default:
return Nothing();
}
}
inline gfx::SurfaceFormat
WrImageFormatToSurfaceFormat(ImageFormat aFormat) {
ImageFormatToSurfaceFormat(ImageFormat aFormat) {
switch (aFormat) {
case ImageFormat::BGRA8:
return gfx::SurfaceFormat::B8G8R8A8;
@ -86,7 +83,7 @@ WrImageFormatToSurfaceFormat(ImageFormat aFormat) {
struct ImageDescriptor: public wr::WrImageDescriptor {
ImageDescriptor(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat)
{
format = SurfaceFormatToWrImageFormat(aFormat).value();
format = wr::SurfaceFormatToImageFormat(aFormat).value();
width = aSize.width;
height = aSize.height;
stride = 0;
@ -95,7 +92,7 @@ struct ImageDescriptor: public wr::WrImageDescriptor {
ImageDescriptor(const gfx::IntSize& aSize, uint32_t aByteStride, gfx::SurfaceFormat aFormat)
{
format = SurfaceFormatToWrImageFormat(aFormat).value();
format = wr::SurfaceFormatToImageFormat(aFormat).value();
width = aSize.width;
height = aSize.height;
stride = aByteStride;
@ -153,7 +150,7 @@ inline ImageRendering ToImageRendering(gfx::SamplingFilter aFilter)
: ImageRendering::Auto;
}
static inline MixBlendMode ToWrMixBlendMode(gfx::CompositionOp compositionOp)
static inline MixBlendMode ToMixBlendMode(gfx::CompositionOp compositionOp)
{
switch (compositionOp)
{
@ -609,7 +606,7 @@ inline mozilla::Range<uint8_t> MutByteSliceToRange(wr::MutByteSlice aWrSlice) {
struct BuiltDisplayList {
wr::VecU8 dl;
wr::WrBuiltDisplayListDescriptor dl_desc;
wr::BuiltDisplayListDescriptor dl_desc;
};
static inline wr::WrFilterOpType ToWrFilterOpType(const layers::CSSFilterType type) {

Просмотреть файл

@ -18,15 +18,6 @@ use euclid::SideOffsets2D;
extern crate webrender_api;
type WrAPI = RenderApi;
type WrBoxShadowClipMode = BoxShadowClipMode;
type WrBuiltDisplayListDescriptor = BuiltDisplayListDescriptor;
type WrImageFormat = ImageFormat;
type WrImageRendering = ImageRendering;
type WrMixBlendMode = MixBlendMode;
type WrTransformStyle = TransformStyle;
type WrRenderer = Renderer;
/// cbindgen:field-names=[mNamespace, mHandle]
type WrExternalImageBufferType = ExternalImageType;
@ -169,7 +160,7 @@ impl From<ImageMask> for WrImageMask {
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct WrImageDescriptor {
pub format: WrImageFormat,
pub format: ImageFormat,
pub width: u32,
pub height: u32,
pub stride: u32,
@ -411,7 +402,7 @@ impl webrender_api::RenderNotifier for CppNotifier {
}
#[no_mangle]
pub extern "C" fn wr_renderer_set_external_image_handler(renderer: &mut WrRenderer,
pub extern "C" fn wr_renderer_set_external_image_handler(renderer: &mut Renderer,
external_image_handler: *mut WrExternalImageHandler) {
if !external_image_handler.is_null() {
renderer.set_external_image_handler(Box::new(unsafe {
@ -426,12 +417,12 @@ pub extern "C" fn wr_renderer_set_external_image_handler(renderer: &mut WrRender
}
#[no_mangle]
pub extern "C" fn wr_renderer_update(renderer: &mut WrRenderer) {
pub extern "C" fn wr_renderer_update(renderer: &mut Renderer) {
renderer.update();
}
#[no_mangle]
pub extern "C" fn wr_renderer_render(renderer: &mut WrRenderer,
pub extern "C" fn wr_renderer_render(renderer: &mut Renderer,
width: u32,
height: u32) {
renderer.render(DeviceUintSize::new(width, height));
@ -439,7 +430,7 @@ pub extern "C" fn wr_renderer_render(renderer: &mut WrRenderer,
// Call wr_renderer_render() before calling this function.
#[no_mangle]
pub unsafe extern "C" fn wr_renderer_readback(renderer: &mut WrRenderer,
pub unsafe extern "C" fn wr_renderer_readback(renderer: &mut Renderer,
width: u32,
height: u32,
dst_buffer: *mut u8,
@ -455,13 +446,13 @@ pub unsafe extern "C" fn wr_renderer_readback(renderer: &mut WrRenderer,
}
#[no_mangle]
pub extern "C" fn wr_renderer_set_profiler_enabled(renderer: &mut WrRenderer,
pub extern "C" fn wr_renderer_set_profiler_enabled(renderer: &mut Renderer,
enabled: bool) {
renderer.set_profiler_enabled(enabled);
}
#[no_mangle]
pub extern "C" fn wr_renderer_current_epoch(renderer: &mut WrRenderer,
pub extern "C" fn wr_renderer_current_epoch(renderer: &mut Renderer,
pipeline_id: WrPipelineId,
out_epoch: &mut WrEpoch)
-> bool {
@ -474,7 +465,7 @@ pub extern "C" fn wr_renderer_current_epoch(renderer: &mut WrRenderer,
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_renderer_delete(renderer: *mut WrRenderer) {
pub unsafe extern "C" fn wr_renderer_delete(renderer: *mut Renderer) {
Box::from_raw(renderer);
}
@ -483,7 +474,7 @@ pub struct WrRenderedEpochs {
}
#[no_mangle]
pub unsafe extern "C" fn wr_renderer_flush_rendered_epochs(renderer: &mut WrRenderer) -> *mut WrRenderedEpochs {
pub unsafe extern "C" fn wr_renderer_flush_rendered_epochs(renderer: &mut Renderer) -> *mut WrRenderedEpochs {
let map = renderer.flush_rendered_epochs();
let pipeline_epochs = Box::new(WrRenderedEpochs {
data: map.into_iter().collect(),
@ -539,8 +530,8 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
gl_context: *mut c_void,
thread_pool: *mut WrThreadPool,
enable_profiler: bool,
out_api: &mut *mut WrAPI,
out_renderer: &mut *mut WrRenderer)
out_api: &mut *mut RenderApi,
out_renderer: &mut *mut Renderer)
-> bool {
assert!(unsafe { is_in_render_thread() });
@ -579,10 +570,10 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
};
let window_size = DeviceUintSize::new(window_width, window_height);
let (renderer, sender) = match WrRenderer::new(gl, opts, window_size) {
let (renderer, sender) = match Renderer::new(gl, opts, window_size) {
Ok((renderer, sender)) => (renderer, sender),
Err(e) => {
println!(" Failed to create a WrRenderer: {:?}", e);
println!(" Failed to create a Renderer: {:?}", e);
let msg = CString::new(format!("wr_window_new: {:?}", e)).unwrap();
unsafe {
gfx_critical_note(msg.as_ptr());
@ -603,13 +594,13 @@ pub extern "C" fn wr_window_new(window_id: WrWindowId,
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_delete(api: *mut WrAPI) {
pub unsafe extern "C" fn wr_api_delete(api: *mut RenderApi) {
let api = Box::from_raw(api);
api.shut_down();
}
#[no_mangle]
pub extern "C" fn wr_api_add_image(api: &mut WrAPI,
pub extern "C" fn wr_api_add_image(api: &mut RenderApi,
image_key: WrImageKey,
descriptor: &WrImageDescriptor,
bytes: ByteSlice) {
@ -622,7 +613,7 @@ pub extern "C" fn wr_api_add_image(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_add_blob_image(api: &mut WrAPI,
pub extern "C" fn wr_api_add_blob_image(api: &mut RenderApi,
image_key: WrImageKey,
descriptor: &WrImageDescriptor,
bytes: ByteSlice) {
@ -635,7 +626,7 @@ pub extern "C" fn wr_api_add_blob_image(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_add_external_image(api: &mut WrAPI,
pub extern "C" fn wr_api_add_external_image(api: &mut RenderApi,
image_key: WrImageKey,
descriptor: &WrImageDescriptor,
external_image_id: WrExternalImageId,
@ -653,7 +644,7 @@ pub extern "C" fn wr_api_add_external_image(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_add_external_image_buffer(api: &mut WrAPI,
pub extern "C" fn wr_api_add_external_image_buffer(api: &mut RenderApi,
image_key: WrImageKey,
descriptor: &WrImageDescriptor,
external_image_id: WrExternalImageId) {
@ -669,7 +660,7 @@ pub extern "C" fn wr_api_add_external_image_buffer(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_update_image(api: &mut WrAPI,
pub extern "C" fn wr_api_update_image(api: &mut RenderApi,
key: WrImageKey,
descriptor: &WrImageDescriptor,
bytes: ByteSlice) {
@ -680,21 +671,21 @@ pub extern "C" fn wr_api_update_image(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_delete_image(api: &mut WrAPI,
pub extern "C" fn wr_api_delete_image(api: &mut RenderApi,
key: WrImageKey) {
assert!(unsafe { is_in_compositor_thread() });
api.delete_image(key)
}
#[no_mangle]
pub extern "C" fn wr_api_set_root_pipeline(api: &mut WrAPI,
pub extern "C" fn wr_api_set_root_pipeline(api: &mut RenderApi,
pipeline_id: WrPipelineId) {
api.set_root_pipeline(pipeline_id);
api.generate_frame(None);
}
#[no_mangle]
pub extern "C" fn wr_api_set_window_parameters(api: &mut WrAPI,
pub extern "C" fn wr_api_set_window_parameters(api: &mut RenderApi,
width: i32,
height: i32) {
let size = DeviceUintSize::new(width as u32, height as u32);
@ -702,14 +693,14 @@ pub extern "C" fn wr_api_set_window_parameters(api: &mut WrAPI,
}
#[no_mangle]
pub unsafe extern "C" fn wr_api_set_root_display_list(api: &mut WrAPI,
pub unsafe extern "C" fn wr_api_set_root_display_list(api: &mut RenderApi,
color: ColorF,
epoch: WrEpoch,
viewport_width: f32,
viewport_height: f32,
pipeline_id: WrPipelineId,
content_size: LayoutSize,
dl_descriptor: WrBuiltDisplayListDescriptor,
dl_descriptor: BuiltDisplayListDescriptor,
dl_data: *mut u8,
dl_size: usize) {
let color = if color.a == 0.0 {
@ -736,7 +727,7 @@ pub unsafe extern "C" fn wr_api_set_root_display_list(api: &mut WrAPI,
}
#[no_mangle]
pub unsafe extern "C" fn wr_api_clear_root_display_list(api: &mut WrAPI,
pub unsafe extern "C" fn wr_api_clear_root_display_list(api: &mut RenderApi,
epoch: WrEpoch,
pipeline_id: WrPipelineId) {
let preserve_frame_state = true;
@ -750,12 +741,12 @@ pub unsafe extern "C" fn wr_api_clear_root_display_list(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_generate_frame(api: &mut WrAPI) {
pub extern "C" fn wr_api_generate_frame(api: &mut RenderApi) {
api.generate_frame(None);
}
#[no_mangle]
pub extern "C" fn wr_api_generate_frame_with_properties(api: &mut WrAPI,
pub extern "C" fn wr_api_generate_frame_with_properties(api: &mut RenderApi,
opacity_array: *const WrOpacityProperty,
opacity_count: usize,
transform_array: *const WrTransformProperty,
@ -795,7 +786,7 @@ pub extern "C" fn wr_api_generate_frame_with_properties(api: &mut WrAPI,
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_api_send_external_event(api: &mut WrAPI,
pub extern "C" fn wr_api_send_external_event(api: &mut RenderApi,
evt: usize) {
assert!(unsafe { !is_in_render_thread() });
@ -803,7 +794,7 @@ pub extern "C" fn wr_api_send_external_event(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_add_raw_font(api: &mut WrAPI,
pub extern "C" fn wr_api_add_raw_font(api: &mut RenderApi,
key: WrFontKey,
font_buffer: *mut u8,
buffer_size: usize,
@ -818,14 +809,14 @@ pub extern "C" fn wr_api_add_raw_font(api: &mut WrAPI,
}
#[no_mangle]
pub extern "C" fn wr_api_delete_font(api: &mut WrAPI,
pub extern "C" fn wr_api_delete_font(api: &mut RenderApi,
key: WrFontKey) {
assert!(unsafe { is_in_compositor_thread() });
api.delete_font(key);
}
#[no_mangle]
pub unsafe extern "C" fn wr_api_get_namespace(api: &mut WrAPI) -> WrIdNamespace {
pub unsafe extern "C" fn wr_api_get_namespace(api: &mut RenderApi) -> WrIdNamespace {
api.id_namespace
}
@ -919,8 +910,8 @@ pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
animation_id: u64,
opacity: *const f32,
transform: *const LayoutTransform,
transform_style: WrTransformStyle,
mix_blend_mode: WrMixBlendMode,
transform_style: TransformStyle,
mix_blend_mode: MixBlendMode,
filters: *const WrFilterOp,
filter_count: usize) {
assert!(unsafe { !is_in_render_thread() });
@ -1035,7 +1026,7 @@ pub extern "C" fn wr_dp_pop_scroll_layer(state: &mut WrState) {
}
#[no_mangle]
pub extern "C" fn wr_scroll_layer_with_id(api: &mut WrAPI,
pub extern "C" fn wr_scroll_layer_with_id(api: &mut RenderApi,
pipeline_id: WrPipelineId,
scroll_id: u64,
new_scroll_origin: LayoutPoint) {
@ -1093,7 +1084,7 @@ pub extern "C" fn wr_dp_push_image(state: &mut WrState,
clip: LayoutRect,
stretch_size: LayoutSize,
tile_spacing: LayoutSize,
image_rendering: WrImageRendering,
image_rendering: ImageRendering,
key: WrImageKey) {
assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
@ -1116,7 +1107,7 @@ pub extern "C" fn wr_dp_push_yuv_planar_image(state: &mut WrState,
image_key_1: WrImageKey,
image_key_2: WrImageKey,
color_space: WrYuvColorSpace,
image_rendering: WrImageRendering) {
image_rendering: ImageRendering) {
assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
state.frame_builder
@ -1136,7 +1127,7 @@ pub extern "C" fn wr_dp_push_yuv_NV12_image(state: &mut WrState,
image_key_0: WrImageKey,
image_key_1: WrImageKey,
color_space: WrYuvColorSpace,
image_rendering: WrImageRendering) {
image_rendering: ImageRendering) {
assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
state.frame_builder
@ -1155,7 +1146,7 @@ pub extern "C" fn wr_dp_push_yuv_interleaved_image(state: &mut WrState,
clip: LayoutRect,
image_key_0: WrImageKey,
color_space: WrYuvColorSpace,
image_rendering: WrImageRendering) {
image_rendering: ImageRendering) {
assert!(unsafe { is_in_main_thread() || is_in_compositor_thread() });
state.frame_builder
@ -1390,7 +1381,7 @@ pub extern "C" fn wr_dp_push_box_shadow(state: &mut WrState,
blur_radius: f32,
spread_radius: f32,
border_radius: f32,
clip_mode: WrBoxShadowClipMode) {
clip_mode: BoxShadowClipMode) {
assert!(unsafe { is_in_main_thread() });
state.frame_builder
@ -1409,7 +1400,7 @@ pub extern "C" fn wr_dp_push_box_shadow(state: &mut WrState,
#[no_mangle]
pub unsafe extern "C" fn wr_api_finalize_builder(state: &mut WrState,
content_size: &mut LayoutSize,
dl_descriptor: &mut WrBuiltDisplayListDescriptor,
dl_descriptor: &mut BuiltDisplayListDescriptor,
dl_data: &mut WrVecU8) {
let frame_builder = mem::replace(&mut state.frame_builder,
WebRenderFrameBuilder::new(state.pipeline_id,
@ -1423,7 +1414,7 @@ pub unsafe extern "C" fn wr_api_finalize_builder(state: &mut WrState,
#[no_mangle]
pub extern "C" fn wr_dp_push_built_display_list(state: &mut WrState,
dl_descriptor: WrBuiltDisplayListDescriptor,
dl_descriptor: BuiltDisplayListDescriptor,
dl_data: &mut WrVecU8) {
let dl_vec = mem::replace(dl_data, WrVecU8::from_vec(Vec::new())).to_vec();
@ -1442,7 +1433,7 @@ extern "C" {
pub fn wr_moz2d_render_cb(blob: ByteSlice,
width: u32,
height: u32,
format: WrImageFormat,
format: ImageFormat,
output: MutByteSlice)
-> bool;
}

Просмотреть файл

@ -34,6 +34,14 @@ enum class BorderStyle : uint32_t {
Sentinel /* this must be last for serialization purposes. */
};
enum class BoxShadowClipMode : uint32_t {
None = 0,
Outset = 1,
Inset = 2,
Sentinel /* this must be last for serialization purposes. */
};
enum class ExtendMode : uint32_t {
Clamp = 0,
Repeat = 1,
@ -41,6 +49,46 @@ enum class ExtendMode : uint32_t {
Sentinel /* this must be last for serialization purposes. */
};
enum class ImageFormat : uint32_t {
Invalid = 0,
A8 = 1,
RGB8 = 2,
BGRA8 = 3,
RGBAF32 = 4,
RG8 = 5,
Sentinel /* this must be last for serialization purposes. */
};
enum class ImageRendering : uint32_t {
Auto = 0,
CrispEdges = 1,
Pixelated = 2,
Sentinel /* this must be last for serialization purposes. */
};
enum class MixBlendMode : uint32_t {
Normal = 0,
Multiply = 1,
Screen = 2,
Overlay = 3,
Darken = 4,
Lighten = 5,
ColorDodge = 6,
ColorBurn = 7,
HardLight = 8,
SoftLight = 9,
Difference = 10,
Exclusion = 11,
Hue = 12,
Saturation = 13,
Color = 14,
Luminosity = 15,
Sentinel /* this must be last for serialization purposes. */
};
enum class RepeatMode : uint32_t {
Stretch = 0,
Repeat = 1,
@ -50,10 +98,9 @@ enum class RepeatMode : uint32_t {
Sentinel /* this must be last for serialization purposes. */
};
enum class WrBoxShadowClipMode : uint32_t {
None = 0,
Outset = 1,
Inset = 2,
enum class TransformStyle : uint32_t {
Flat = 0,
Preserve3D = 1,
Sentinel /* this must be last for serialization purposes. */
};
@ -88,53 +135,6 @@ enum class WrFilterOpType : uint32_t {
Sentinel /* this must be last for serialization purposes. */
};
enum class WrImageFormat : uint32_t {
Invalid = 0,
A8 = 1,
RGB8 = 2,
BGRA8 = 3,
RGBAF32 = 4,
RG8 = 5,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrImageRendering : uint32_t {
Auto = 0,
CrispEdges = 1,
Pixelated = 2,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrMixBlendMode : uint32_t {
Normal = 0,
Multiply = 1,
Screen = 2,
Overlay = 3,
Darken = 4,
Lighten = 5,
ColorDodge = 6,
ColorBurn = 7,
HardLight = 8,
SoftLight = 9,
Difference = 10,
Exclusion = 11,
Hue = 12,
Saturation = 13,
Color = 14,
Luminosity = 15,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrTransformStyle : uint32_t {
Flat = 0,
Preserve3D = 1,
Sentinel /* this must be last for serialization purposes. */
};
enum class WrYuvColorSpace : uint32_t {
Rec601 = 0,
Rec709 = 1,
@ -144,12 +144,12 @@ enum class WrYuvColorSpace : uint32_t {
struct LayerPixel;
struct WrAPI;
struct RenderApi;
struct Renderer;
struct WrRenderedEpochs;
struct WrRenderer;
struct WrState;
struct WrThreadPool;
@ -165,7 +165,7 @@ struct WrImageKey {
};
struct WrImageDescriptor {
WrImageFormat format;
ImageFormat format;
uint32_t width;
uint32_t height;
uint32_t stride;
@ -242,11 +242,11 @@ struct LayoutSize {
}
};
struct WrBuiltDisplayListDescriptor {
struct BuiltDisplayListDescriptor {
uint64_t builder_start_time;
uint64_t builder_finish_time;
bool operator==(const WrBuiltDisplayListDescriptor& aOther) const {
bool operator==(const BuiltDisplayListDescriptor& aOther) const {
return builder_start_time == aOther.builder_start_time &&
builder_finish_time == aOther.builder_finish_time;
}
@ -595,14 +595,14 @@ struct WrExternalImageHandler {
*/
WR_INLINE
void wr_api_add_blob_image(WrAPI *aApi,
void wr_api_add_blob_image(RenderApi *aApi,
WrImageKey aImageKey,
const WrImageDescriptor *aDescriptor,
ByteSlice aBytes)
WR_FUNC;
WR_INLINE
void wr_api_add_external_image(WrAPI *aApi,
void wr_api_add_external_image(RenderApi *aApi,
WrImageKey aImageKey,
const WrImageDescriptor *aDescriptor,
WrExternalImageId aExternalImageId,
@ -611,21 +611,21 @@ void wr_api_add_external_image(WrAPI *aApi,
WR_FUNC;
WR_INLINE
void wr_api_add_external_image_buffer(WrAPI *aApi,
void wr_api_add_external_image_buffer(RenderApi *aApi,
WrImageKey aImageKey,
const WrImageDescriptor *aDescriptor,
WrExternalImageId aExternalImageId)
WR_FUNC;
WR_INLINE
void wr_api_add_image(WrAPI *aApi,
void wr_api_add_image(RenderApi *aApi,
WrImageKey aImageKey,
const WrImageDescriptor *aDescriptor,
ByteSlice aBytes)
WR_FUNC;
WR_INLINE
void wr_api_add_raw_font(WrAPI *aApi,
void wr_api_add_raw_font(RenderApi *aApi,
WrFontKey aKey,
uint8_t *aFontBuffer,
size_t aBufferSize,
@ -633,38 +633,38 @@ void wr_api_add_raw_font(WrAPI *aApi,
WR_FUNC;
WR_INLINE
void wr_api_clear_root_display_list(WrAPI *aApi,
void wr_api_clear_root_display_list(RenderApi *aApi,
WrEpoch aEpoch,
WrPipelineId aPipelineId)
WR_FUNC;
WR_INLINE
void wr_api_delete(WrAPI *aApi)
void wr_api_delete(RenderApi *aApi)
WR_DESTRUCTOR_SAFE_FUNC;
WR_INLINE
void wr_api_delete_font(WrAPI *aApi,
void wr_api_delete_font(RenderApi *aApi,
WrFontKey aKey)
WR_FUNC;
WR_INLINE
void wr_api_delete_image(WrAPI *aApi,
void wr_api_delete_image(RenderApi *aApi,
WrImageKey aKey)
WR_FUNC;
WR_INLINE
void wr_api_finalize_builder(WrState *aState,
LayoutSize *aContentSize,
WrBuiltDisplayListDescriptor *aDlDescriptor,
BuiltDisplayListDescriptor *aDlDescriptor,
WrVecU8 *aDlData)
WR_FUNC;
WR_INLINE
void wr_api_generate_frame(WrAPI *aApi)
void wr_api_generate_frame(RenderApi *aApi)
WR_FUNC;
WR_INLINE
void wr_api_generate_frame_with_properties(WrAPI *aApi,
void wr_api_generate_frame_with_properties(RenderApi *aApi,
const WrOpacityProperty *aOpacityArray,
size_t aOpacityCount,
const WrTransformProperty *aTransformArray,
@ -672,40 +672,40 @@ void wr_api_generate_frame_with_properties(WrAPI *aApi,
WR_FUNC;
WR_INLINE
WrIdNamespace wr_api_get_namespace(WrAPI *aApi)
WrIdNamespace wr_api_get_namespace(RenderApi *aApi)
WR_FUNC;
WR_INLINE
void wr_api_send_external_event(WrAPI *aApi,
void wr_api_send_external_event(RenderApi *aApi,
size_t aEvt)
WR_DESTRUCTOR_SAFE_FUNC;
WR_INLINE
void wr_api_set_root_display_list(WrAPI *aApi,
void wr_api_set_root_display_list(RenderApi *aApi,
ColorF aColor,
WrEpoch aEpoch,
float aViewportWidth,
float aViewportHeight,
WrPipelineId aPipelineId,
LayoutSize aContentSize,
WrBuiltDisplayListDescriptor aDlDescriptor,
BuiltDisplayListDescriptor aDlDescriptor,
uint8_t *aDlData,
size_t aDlSize)
WR_FUNC;
WR_INLINE
void wr_api_set_root_pipeline(WrAPI *aApi,
void wr_api_set_root_pipeline(RenderApi *aApi,
WrPipelineId aPipelineId)
WR_FUNC;
WR_INLINE
void wr_api_set_window_parameters(WrAPI *aApi,
void wr_api_set_window_parameters(RenderApi *aApi,
int32_t aWidth,
int32_t aHeight)
WR_FUNC;
WR_INLINE
void wr_api_update_image(WrAPI *aApi,
void wr_api_update_image(RenderApi *aApi,
WrImageKey aKey,
const WrImageDescriptor *aDescriptor,
ByteSlice aBytes)
@ -797,12 +797,12 @@ void wr_dp_push_box_shadow(WrState *aState,
float aBlurRadius,
float aSpreadRadius,
float aBorderRadius,
WrBoxShadowClipMode aClipMode)
BoxShadowClipMode aClipMode)
WR_FUNC;
WR_INLINE
void wr_dp_push_built_display_list(WrState *aState,
WrBuiltDisplayListDescriptor aDlDescriptor,
BuiltDisplayListDescriptor aDlDescriptor,
WrVecU8 *aDlData)
WR_FUNC;
@ -832,7 +832,7 @@ void wr_dp_push_image(WrState *aState,
LayoutRect aClip,
LayoutSize aStretchSize,
LayoutSize aTileSpacing,
WrImageRendering aImageRendering,
ImageRendering aImageRendering,
WrImageKey aKey)
WR_FUNC;
@ -882,8 +882,8 @@ void wr_dp_push_stacking_context(WrState *aState,
uint64_t aAnimationId,
const float *aOpacity,
const LayoutTransform *aTransform,
WrTransformStyle aTransformStyle,
WrMixBlendMode aMixBlendMode,
TransformStyle aTransformStyle,
MixBlendMode aMixBlendMode,
const WrFilterOp *aFilters,
size_t aFilterCount)
WR_FUNC;
@ -906,7 +906,7 @@ void wr_dp_push_yuv_NV12_image(WrState *aState,
WrImageKey aImageKey0,
WrImageKey aImageKey1,
WrYuvColorSpace aColorSpace,
WrImageRendering aImageRendering)
ImageRendering aImageRendering)
WR_FUNC;
WR_INLINE
@ -915,7 +915,7 @@ void wr_dp_push_yuv_interleaved_image(WrState *aState,
LayoutRect aClip,
WrImageKey aImageKey0,
WrYuvColorSpace aColorSpace,
WrImageRendering aImageRendering)
ImageRendering aImageRendering)
WR_FUNC;
WR_INLINE
@ -926,7 +926,7 @@ void wr_dp_push_yuv_planar_image(WrState *aState,
WrImageKey aImageKey1,
WrImageKey aImageKey2,
WrYuvColorSpace aColorSpace,
WrImageRendering aImageRendering)
ImageRendering aImageRendering)
WR_FUNC;
WR_INLINE
@ -940,21 +940,21 @@ bool wr_rendered_epochs_next(WrRenderedEpochs *aPipelineEpochs,
WR_FUNC;
WR_INLINE
bool wr_renderer_current_epoch(WrRenderer *aRenderer,
bool wr_renderer_current_epoch(Renderer *aRenderer,
WrPipelineId aPipelineId,
WrEpoch *aOutEpoch)
WR_FUNC;
WR_INLINE
void wr_renderer_delete(WrRenderer *aRenderer)
void wr_renderer_delete(Renderer *aRenderer)
WR_DESTRUCTOR_SAFE_FUNC;
WR_INLINE
WrRenderedEpochs *wr_renderer_flush_rendered_epochs(WrRenderer *aRenderer)
WrRenderedEpochs *wr_renderer_flush_rendered_epochs(Renderer *aRenderer)
WR_FUNC;
WR_INLINE
void wr_renderer_readback(WrRenderer *aRenderer,
void wr_renderer_readback(Renderer *aRenderer,
uint32_t aWidth,
uint32_t aHeight,
uint8_t *aDstBuffer,
@ -962,27 +962,27 @@ void wr_renderer_readback(WrRenderer *aRenderer,
WR_FUNC;
WR_INLINE
void wr_renderer_render(WrRenderer *aRenderer,
void wr_renderer_render(Renderer *aRenderer,
uint32_t aWidth,
uint32_t aHeight)
WR_FUNC;
WR_INLINE
void wr_renderer_set_external_image_handler(WrRenderer *aRenderer,
void wr_renderer_set_external_image_handler(Renderer *aRenderer,
WrExternalImageHandler *aExternalImageHandler)
WR_FUNC;
WR_INLINE
void wr_renderer_set_profiler_enabled(WrRenderer *aRenderer,
void wr_renderer_set_profiler_enabled(Renderer *aRenderer,
bool aEnabled)
WR_FUNC;
WR_INLINE
void wr_renderer_update(WrRenderer *aRenderer)
void wr_renderer_update(Renderer *aRenderer)
WR_FUNC;
WR_INLINE
void wr_scroll_layer_with_id(WrAPI *aApi,
void wr_scroll_layer_with_id(RenderApi *aApi,
WrPipelineId aPipelineId,
uint64_t aScrollId,
LayoutPoint aNewScrollOrigin)
@ -1016,8 +1016,8 @@ bool wr_window_new(WrWindowId aWindowId,
void *aGlContext,
WrThreadPool *aThreadPool,
bool aEnableProfiler,
WrAPI **aOutApi,
WrRenderer **aOutRenderer)
RenderApi **aOutApi,
Renderer **aOutRenderer)
WR_FUNC;
} // namespace wr

Просмотреть файл

@ -476,7 +476,7 @@ BulletRenderer::CreateWebRenderCommandsForImage(nsDisplayItem* aItem,
aBuilder.PushImage(dest,
dest,
wr::WrImageRendering::Auto,
wr::ImageRendering::Auto,
key.value());
}

Просмотреть файл

@ -5366,7 +5366,7 @@ nsDisplayBoxShadowOuter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder
blurRadius,
spreadRadius,
borderRadius,
wr::WrBoxShadowClipMode::Outset);
wr::BoxShadowClipMode::Outset);
}
}
@ -5524,7 +5524,7 @@ nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(mozilla::wr::Disp
blurRadius,
spreadRadius,
borderRadius,
wr::WrBoxShadowClipMode::Inset
wr::BoxShadowClipMode::Inset
);
}
}