Commit 571a0f49 authored by Andrew Osmond's avatar Andrew Osmond
Browse files

Bug 1574493 - Part 2. Remove snapping in frame building. r=kvark

This will be rewritten in a later patch in the series. The shaders will
be provided the correct information and will no longer need to concern
themselves with snapping.

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

--HG--
extra : moz-landing-system : lando
parent 7cda552a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -70,9 +70,7 @@ void main(void) {
            ph.local_clip_rect,
            ph.z,
            transform,
            pic_task,
            ph.local_rect,
            ph.snap_offsets
            pic_task
        );

        // TODO(gw): transform bounds may be referenced by
+1 −17
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * 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/. */

#include rect,render_task,gpu_cache,snap,transform
#include rect,render_task,gpu_cache,transform

#ifdef WR_VERTEX_SHADER

@@ -11,7 +11,6 @@ in ivec4 aClipDataResourceAddress;
in vec2 aClipLocalPos;
in vec4 aClipTileRect;
in vec4 aClipDeviceArea;
in vec4 aClipSnapOffsets;
in vec4 aClipOrigins;
in float aDevicePixelScale;

@@ -23,7 +22,6 @@ struct ClipMaskInstance {
    vec2 local_pos;
    RectWithSize tile_rect;
    RectWithSize sub_rect;
    vec4 snap_offsets;
    vec2 task_origin;
    vec2 screen_origin;
    float device_pixel_scale;
@@ -39,7 +37,6 @@ ClipMaskInstance fetch_clip_item() {
    cmi.local_pos = aClipLocalPos;
    cmi.tile_rect = RectWithSize(aClipTileRect.xy, aClipTileRect.zw);
    cmi.sub_rect = RectWithSize(aClipDeviceArea.xy, aClipDeviceArea.zw);
    cmi.snap_offsets = aClipSnapOffsets;
    cmi.task_origin = aClipOrigins.xy;
    cmi.screen_origin = aClipOrigins.zw;
    cmi.device_pixel_scale = aDevicePixelScale;
@@ -64,23 +61,10 @@ ClipVertexInfo write_clip_tile_vertex(RectWithSize local_clip_rect,
                                      Transform prim_transform,
                                      Transform clip_transform,
                                      RectWithSize sub_rect,
                                      vec4 snap_offsets,
                                      vec2 task_origin,
                                      vec2 screen_origin,
                                      float device_pixel_scale) {
    vec2 device_pos = screen_origin + sub_rect.p0 + aPosition.xy * sub_rect.size;

    // If the primitive we are drawing a clip mask for was snapped, then
    // remove the effect of that snapping, so that the local position
    // interpolation below works correctly relative to the clip item.
    vec2 snap_offset = mix(
        snap_offsets.xy,
        snap_offsets.zw,
        aPosition.xy
    );

    device_pos -= snap_offset;

    vec2 world_pos = device_pos / device_pixel_scale;

    vec4 pos = prim_transform.m * vec4(world_pos, 0.0, 1.0);
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ void main(void) {
        prim_transform,
        clip_transform,
        cmi.sub_rect,
        cmi.snap_offsets,
        cmi.task_origin,
        cmi.screen_origin,
        cmi.device_pixel_scale
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ void main(void) {
        prim_transform,
        clip_transform,
        cmi.sub_rect,
        cmi.snap_offsets,
        cmi.task_origin,
        cmi.screen_origin,
        cmi.device_pixel_scale
+0 −1
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ void main(void) {
        prim_transform,
        clip_transform,
        cmi.sub_rect,
        cmi.snap_offsets,
        cmi.task_origin,
        cmi.screen_origin,
        cmi.device_pixel_scale
Loading