Skip to content

Commit

Permalink
Bug 1573343 - Make the aInvalidRegion parameter of EndRemoteDrawing a…
Browse files Browse the repository at this point in the history
… const reference rather than a regular reference. r=mattwoodrow

There's no point in mutating it, and nobody does.

Differential Revision: https://phabricator.services.mozilla.com/D41679

--HG--
extra : moz-landing-system : lando
  • Loading branch information
mstange committed Aug 19, 2019
1 parent 9fd442a commit cc120aa
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
5 changes: 3 additions & 2 deletions widget/CompositorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ class CompositorWidget {
* after each composition.
*/
virtual void EndRemoteDrawing() {}
virtual void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) {
virtual void EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget,
const LayoutDeviceIntRegion& aInvalidRegion) {
EndRemoteDrawing();
}

Expand Down
2 changes: 1 addition & 1 deletion widget/InProcessCompositorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void InProcessCompositorWidget::EndRemoteDrawing() {
}

void InProcessCompositorWidget::EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget, LayoutDeviceIntRegion& aInvalidRegion) {
gfx::DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
mWidget->EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion);
}

Expand Down
2 changes: 1 addition & 1 deletion widget/InProcessCompositorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class InProcessCompositorWidget : public CompositorWidget {
virtual void EndRemoteDrawing() override;
virtual void EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) override;
const LayoutDeviceIntRegion& aInvalidRegion) override;
virtual void CleanupRemoteDrawing() override;
virtual void CleanupWindowEffects() override;
virtual bool InitCompositor(layers::Compositor* aCompositor) override;
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/GtkCompositorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ GtkCompositorWidget::StartRemoteDrawingInRegion(
}

void GtkCompositorWidget::EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget, LayoutDeviceIntRegion& aInvalidRegion) {
gfx::DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
mProvider.EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion);
}

Expand Down
5 changes: 3 additions & 2 deletions widget/gtk/GtkCompositorWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ class GtkCompositorWidget : public CompositorWidget,
already_AddRefed<gfx::DrawTarget> StartRemoteDrawingInRegion(
LayoutDeviceIntRegion& aInvalidRegion,
layers::BufferMode* aBufferMode) override;
void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) override;
void EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget,
const LayoutDeviceIntRegion& aInvalidRegion) override;
uintptr_t GetWidgetKey() override;

LayoutDeviceIntSize GetClientSize() override;
Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/WindowSurfaceProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ WindowSurfaceProvider::StartRemoteDrawingInRegion(
}

void WindowSurfaceProvider::EndRemoteDrawingInRegion(
gfx::DrawTarget* aDrawTarget, LayoutDeviceIntRegion& aInvalidRegion) {
gfx::DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
if (mWindowSurface) mWindowSurface->Commit(aInvalidRegion);
}

Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/WindowSurfaceProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class WindowSurfaceProvider final {
already_AddRefed<gfx::DrawTarget> StartRemoteDrawingInRegion(
LayoutDeviceIntRegion& aInvalidRegion, layers::BufferMode* aBufferMode);
void EndRemoteDrawingInRegion(gfx::DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion);
const LayoutDeviceIntRegion& aInvalidRegion);

private:
UniquePtr<WindowSurface> CreateWindowSurface();
Expand Down
4 changes: 2 additions & 2 deletions widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6287,8 +6287,8 @@ already_AddRefed<DrawTarget> nsWindow::StartRemoteDrawingInRegion(
aBufferMode);
}

void nsWindow::EndRemoteDrawingInRegion(DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) {
void nsWindow::EndRemoteDrawingInRegion(
DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
mSurfaceProvider.EndRemoteDrawingInRegion(aDrawTarget, aInvalidRegion);
}

Expand Down
2 changes: 1 addition & 1 deletion widget/gtk/nsWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class nsWindow final : public nsBaseWidget {
mozilla::layers::BufferMode* aBufferMode) override;
virtual void EndRemoteDrawingInRegion(
mozilla::gfx::DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) override;
const LayoutDeviceIntRegion& aInvalidRegion) override;

void SetProgress(unsigned long progressPercent);

Expand Down
4 changes: 2 additions & 2 deletions widget/nsBaseWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference {
return StartRemoteDrawing();
}
virtual void EndRemoteDrawing() {}
virtual void EndRemoteDrawingInRegion(DrawTarget* aDrawTarget,
LayoutDeviceIntRegion& aInvalidRegion) {
virtual void EndRemoteDrawingInRegion(
DrawTarget* aDrawTarget, const LayoutDeviceIntRegion& aInvalidRegion) {
EndRemoteDrawing();
}
virtual void CleanupRemoteDrawing() {}
Expand Down

0 comments on commit cc120aa

Please sign in to comment.