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

Unified Diff: cc/output/direct_renderer.cc

Issue 2646243002: Use IDCompositionSurface to implement DirectCompositionSurfaceWin. (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: cc/output/direct_renderer.cc
diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc
index cd4bfa5006e9eb30ab850e1dcd83f1d5b9e41ff8..3bec96b0c2ab97cc5e2aa89c26d49c524a6f88fe 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) {
+ use_set_draw_rectangle_ = true;
+ }
+
initialized_ = true;
}
@@ -519,10 +524,11 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame,
ComputeScissorRectForRenderPass(frame));
}
- bool render_pass_is_clipped =
- !render_pass_scissor_in_draw_space.Contains(surface_rect_in_draw_space);
bool is_root_render_pass =
frame->current_render_pass == frame->root_render_pass;
+ bool render_pass_is_clipped =
+ (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 =
@@ -593,9 +599,13 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame,
bool DirectRenderer::UseRenderPass(DrawingFrame* frame,
const RenderPass* render_pass) {
frame->current_render_pass = render_pass;
- frame->current_texture = NULL;
+ frame->current_texture = nullptr;
if (render_pass == frame->root_render_pass) {
BindFramebufferToOutputSurface(frame);
+
+ if (use_set_draw_rectangle_)
+ output_surface_->SetDrawRectangle(frame->root_damage_rect);
+
InitializeViewport(frame, render_pass->output_rect,
gfx::Rect(frame->device_viewport_size),
frame->device_viewport_size);

Powered by Google App Engine
This is Rietveld 408576698