Index: cc/output/direct_renderer.cc |
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc |
index 51ac56a1d932e68ad95daee619701438539fa876..b15227f1dcdddabaea5529699d4a8b8aea275e00 100644 |
--- a/cc/output/direct_renderer.cc |
+++ b/cc/output/direct_renderer.cc |
@@ -333,19 +333,36 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame, |
bool using_scissor_as_optimization = |
Capabilities().using_partial_swap && allow_partial_swap; |
gfx::RectF render_pass_scissor; |
+ bool redraw_rect_covers_full_surface = true; |
danakj
2013/09/20 00:41:46
ok cool.. don't hate me for suggesting: "draw_rect
piman
2013/09/20 00:51:51
Done.
|
+ if (frame->current_render_pass == frame->root_render_pass && |
+ !client_->DeviceViewport().Contains( |
+ gfx::Rect(output_surface_->SurfaceSize()))) |
+ redraw_rect_covers_full_surface = false; |
if (using_scissor_as_optimization) { |
render_pass_scissor = ComputeScissorRectForRenderPass(frame); |
SetScissorTestRectInDrawSpace(frame, render_pass_scissor); |
+ if (!render_pass_scissor.Contains(frame->current_render_pass->output_rect)) |
+ redraw_rect_covers_full_surface = false; |
} |
if (frame->current_render_pass != frame->root_render_pass || |
settings_->should_clear_root_render_pass) { |
- if (NeedDeviceClip(frame)) |
+ if (NeedDeviceClip(frame)) { |
SetScissorTestRect(DeviceClipRect(frame)); |
- else if (!using_scissor_as_optimization) |
+ redraw_rect_covers_full_surface = false; |
+ } else if (!using_scissor_as_optimization) { |
EnsureScissorTestDisabled(); |
- ClearFramebuffer(frame); |
+ } |
+ |
+ bool has_external_stencil_test = |
+ output_surface_->HasExternalStencilTest() && |
+ frame->current_render_pass == frame->root_render_pass; |
+ |
+ DiscardPixels(has_external_stencil_test, |
+ redraw_rect_covers_full_surface); |
+ ClearFramebuffer(frame, |
danakj
2013/09/20 00:41:46
git cl format? :)
piman
2013/09/20 00:51:51
Done.
|
+ has_external_stencil_test); |
} |
const QuadList& quad_list = render_pass->quad_list; |