Index: cc/output/direct_renderer.cc |
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc |
index 3b88d774b9483690f05f38855270d037dd31c818..3d371f78047e6ec6522bfec701dfb56db9502820 100644 |
--- a/cc/output/direct_renderer.cc |
+++ b/cc/output/direct_renderer.cc |
@@ -88,6 +88,11 @@ void DirectRenderer::Initialize() { |
context_provider->ContextCapabilities().commit_overlay_planes) |
allow_empty_swap_ = true; |
+ if (context_provider && |
+ context_provider->ContextCapabilities().set_draw_rectangle) { |
danakj
2017/02/15 16:01:01
nit: no {}, or merge this with the conditions abov
|
+ use_set_draw_rectangle_ = true; |
+ } |
+ |
initialized_ = true; |
} |
@@ -510,10 +515,11 @@ void DirectRenderer::DrawRenderPass(const RenderPass* render_pass) { |
current_frame()->ComputeScissorRectForRenderPass()); |
} |
- bool render_pass_is_clipped = |
- !render_pass_scissor_in_draw_space.Contains(surface_rect_in_draw_space); |
bool is_root_render_pass = |
current_frame()->current_render_pass == current_frame()->root_render_pass; |
+ bool render_pass_is_clipped = |
danakj
2017/02/15 16:01:01
Can you explain why use_set_draw_rectangle_ implie
|
+ (use_set_draw_rectangle_ && is_root_render_pass) || |
+ !render_pass_scissor_in_draw_space.Contains(surface_rect_in_draw_space); |
bool has_external_stencil_test = |
is_root_render_pass && output_surface_->HasExternalStencilTest(); |
bool should_clear_surface = |
@@ -582,9 +588,12 @@ void DirectRenderer::DrawRenderPass(const RenderPass* render_pass) { |
bool DirectRenderer::UseRenderPass(const RenderPass* render_pass) { |
current_frame()->current_render_pass = render_pass; |
- current_frame()->current_texture = NULL; |
+ current_frame()->current_texture = nullptr; |
if (render_pass == current_frame()->root_render_pass) { |
BindFramebufferToOutputSurface(); |
+ |
+ if (use_set_draw_rectangle_) |
+ output_surface_->SetDrawRectangle(current_frame()->root_damage_rect); |
InitializeViewport(current_frame(), render_pass->output_rect, |
gfx::Rect(current_frame()->device_viewport_size), |
current_frame()->device_viewport_size); |