Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1379)

Unified Diff: cc/output/direct_renderer.cc

Issue 24239006: cc: Don't discard framebuffer when using partial swaps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index 51ac56a1d932e68ad95daee619701438539fa876..aad41ed293f212da2fcedb88cde55532576b001d 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -333,19 +333,34 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame,
bool using_scissor_as_optimization =
Capabilities().using_partial_swap && allow_partial_swap;
gfx::RectF render_pass_scissor;
+ bool draw_rect_covers_full_surface = true;
+ if (frame->current_render_pass == frame->root_render_pass &&
+ !client_->DeviceViewport().Contains(
+ gfx::Rect(output_surface_->SurfaceSize())))
+ draw_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))
+ draw_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)
+ draw_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, draw_rect_covers_full_surface);
+ ClearFramebuffer(frame, has_external_stencil_test);
}
const QuadList& quad_list = render_pass->quad_list;
« no previous file with comments | « cc/output/direct_renderer.h ('k') | cc/output/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698