         bvec4 edge_mask = notEqual(edge_flags & ivec4(1, 2, 4, 8), ivec4(0));
 
         vi = write_transform_vertex(
-            local_segment_rect,
+            segment_rect,
             ph.local_rect,
             ph.local_clip_rect,
             mix(vec4(0.0), vec4(1.0), edge_mask),

    // Write the normal vertex information out.
    if (transform.is_axis_aligned) {
        vi = write_vertex(
            local_segment_rect,
            ph.local_clip_rect,
            ph.z,
            transform,

    PrimitiveHeader ph = fetch_prim_header(prim_header_address);

    // Fetch the segment of this brush primitive we are drawing.
    vec4 segment_data;
    RectWithSize segment_rect;
    if (segment_index == 0xffff) {
        segment_rect = ph.local_rect;
        segment_data = vec4(0.0);
    } else {
        int segment_address = ph.specific_prim_address +
                              VECS_PER_SPECIFIC_BRUSH +
                              segment_index * VECS_PER_SEGMENT;

        vec4 segment_info[2] = fetch_from_gpu_cache_2(segment_address);
        segment_rect = RectWithSize(segment_info[0].xy, segment_info[0].zw);
        segment_data = segment_info[1];
    }

    VertexInfo vi;

