hwc: Add scissor functionality to layer stitch.

-- Scissor locks any pixel operation within the scissor region.
-- Clear the whole slice before writing into it.

Change-Id: I1c27ad4d82d7150b11f0d8f164843431b559709e
CRs-Fixed: 2617040
diff --git a/composer/hwc_display_builtin.cpp b/composer/hwc_display_builtin.cpp
index a1e79c0..45d9db8 100644
--- a/composer/hwc_display_builtin.cpp
+++ b/composer/hwc_display_builtin.cpp
@@ -298,7 +298,8 @@
     Layer *stitch_layer = stitch_target_->GetSDMLayer();
     LayerBuffer &output_buffer = stitch_layer->input_buffer;
     ctx.dst_hnd = reinterpret_cast<const private_handle_t *>(output_buffer.buffer_id);
-    SetRect(layer->stitch_dst_rect, &ctx.dst_rect);
+    SetRect(layer->stitch_info.dst_rect, &ctx.dst_rect);
+    SetRect(layer->stitch_info.slice_rect, &ctx.scissor_rect);
     ctx.src_acquire_fence = input_buffer.acquire_fence;
 
     layer_stitch_task_.PerformTask(LayerStitchTaskCode::kCodeStitch, &ctx);
@@ -1248,8 +1249,8 @@
         DTRACE_SCOPED();
         LayerStitchContext* ctx = reinterpret_cast<LayerStitchContext*>(task_context);
         gl_layer_stitch_->Blit(ctx->src_hnd, ctx->dst_hnd, ctx->src_rect, ctx->dst_rect,
-                               ctx->src_acquire_fence, ctx->dst_acquire_fence,
-                               &(ctx->release_fence));
+                               ctx->scissor_rect, ctx->src_acquire_fence,
+                               ctx->dst_acquire_fence, &(ctx->release_fence));
       }
       break;
     case LayerStitchTaskCode::kCodeDestroyInstance: {