Commit 6d0dfe44 authored by Lee Salzman's avatar Lee Salzman
Browse files

Bug 1690216 - Clarify that StartRemoteDrawingInRegion does not actually modify...

Bug 1690216 - Clarify that StartRemoteDrawingInRegion does not actually modify the region. r=mattwoodrow

It caused us substantial confusion investigating this bug under the belief that
StartRemoteDrawingInRegion may have been modifying the dirty region. None of our
existing widget code anymore uses the API in this way, so it makes sense to just
force this dirty region to be const so that we no longer support the assumption
and alleviate confusion in the future about how our widget code actually behaves.

Depends on D106246

Differential Revision: https://phabricator.services.mozilla.com/D106247
parent 8632afe0
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -720,7 +720,7 @@ impl SwCompositeThread {
        }
    }

    fn start_compositing(&self) {
    fn prepare_for_composites(&self) {
        // Initialize the job count to 1 to prevent spurious signaling of job completion
        // in the middle of queuing compositing jobs until we're actually waiting for
        // composition.
@@ -1693,7 +1693,8 @@ impl Compositor for SwCompositor {

            self.locked_framebuffer = self.gl.lock_framebuffer(0);

            composite_thread.start_compositing();
            composite_thread.prepare_for_composites();

            // Issue any initial composite jobs for the SwComposite thread.
            let mut lock = composite_thread.lock();
            for &(ref id, ref transform, ref clip_rect, filter) in &self.frame_surfaces {
@@ -1761,7 +1762,7 @@ impl Compositor for SwCompositor {
                // phase. These late surfaces don't have any overlap/dependency tracking,
                // so we just queue them directly and wait synchronously for the composite
                // thread to process them in order.
                composite_thread.start_compositing();
                composite_thread.prepare_for_composites();
                {
                    let mut lock = composite_thread.lock();
                    for &(ref id, ref transform, ref clip_rect, filter) in &self.late_surfaces {
+2 −1
Original line number Diff line number Diff line
@@ -137,7 +137,8 @@ class CompositorWidget {
   */
  virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing();
  virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawingInRegion(
      LayoutDeviceIntRegion& aInvalidRegion, layers::BufferMode* aBufferMode) {
      const LayoutDeviceIntRegion& aInvalidRegion,
      layers::BufferMode* aBufferMode) {
    return StartRemoteDrawing();
  }

+2 −1
Original line number Diff line number Diff line
@@ -67,7 +67,8 @@ InProcessCompositorWidget::StartRemoteDrawing() {

already_AddRefed<gfx::DrawTarget>
InProcessCompositorWidget::StartRemoteDrawingInRegion(
    LayoutDeviceIntRegion& aInvalidRegion, layers::BufferMode* aBufferMode) {
    const LayoutDeviceIntRegion& aInvalidRegion,
    layers::BufferMode* aBufferMode) {
  return mWidget->StartRemoteDrawingInRegion(aInvalidRegion, aBufferMode);
}

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ class InProcessCompositorWidget : public CompositorWidget {
  virtual RefPtr<layers::NativeLayerRoot> GetNativeLayerRoot() override;
  virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawing() override;
  virtual already_AddRefed<gfx::DrawTarget> StartRemoteDrawingInRegion(
      LayoutDeviceIntRegion& aInvalidRegion,
      const LayoutDeviceIntRegion& aInvalidRegion,
      layers::BufferMode* aBufferMode) override;
  virtual void EndRemoteDrawing() override;
  virtual void EndRemoteDrawingInRegion(
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ AndroidCompositorWidget::~AndroidCompositorWidget() {

already_AddRefed<gfx::DrawTarget>
AndroidCompositorWidget::StartRemoteDrawingInRegion(
    LayoutDeviceIntRegion& aInvalidRegion, layers::BufferMode* aBufferMode) {
    const LayoutDeviceIntRegion& aInvalidRegion,
    layers::BufferMode* aBufferMode) {
  if (!mNativeWindow) {
    EGLNativeWindowType window = GetEGLNativeWindow();
    JNIEnv* const env = jni::GetEnvForThread();
Loading