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

Unified Diff: cc/output/direct_renderer.cc

Issue 2829543003: gpu: Empty swaps for surfaceless output surfaces. (Closed)
Patch Set: fix cc_unittests Created 3 years, 8 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 31f0d7ace0e13e7589142f1da6769fdddaef70f2..5edef5c8295ea4029d8dcc3109eb082fdddd1cfe 100644
--- a/cc/output/direct_renderer.cc
+++ b/cc/output/direct_renderer.cc
@@ -93,11 +93,16 @@ void DirectRenderer::Initialize() {
use_partial_swap_ = settings_->partial_swap_enabled && CanPartialSwap();
allow_empty_swap_ = use_partial_swap_;
+ allow_partial_swap_ = use_partial_swap_;
if (context_provider) {
if (context_provider->ContextCapabilities().commit_overlay_planes)
allow_empty_swap_ = true;
if (context_provider->ContextCapabilities().dc_layers)
supports_dc_layers_ = true;
+ if (context_provider->ContextCapabilities()
+ .disable_non_empty_post_sub_buffers) {
+ allow_partial_swap_ = false;
jbauman 2017/04/20 21:30:06 If you just set use_partial_swap_=false here, then
reveman 2017/04/20 22:11:40 Good idea. Done.
+ }
}
initialized_ = true;
@@ -343,22 +348,11 @@ void DirectRenderer::DrawFrame(RenderPassList* render_passes_in_draw_order,
// If we have to draw but don't support partial swap, the whole output should
// be considered damaged.
- if (!skip_drawing_root_render_pass && !use_partial_swap_)
+ if (!skip_drawing_root_render_pass && !allow_partial_swap_)
current_frame()->root_damage_rect = root_render_pass->output_rect;
- if (skip_drawing_root_render_pass) {
- // If any of the overlays is the output surface, then ensure that the
- // backbuffer be allocated (allocation of the backbuffer is a side-effect
- // of BindFramebufferToOutputSurface).
- for (auto& overlay : current_frame()->overlay_list) {
- if (overlay.use_output_surface_for_resource) {
- BindFramebufferToOutputSurface();
- break;
- }
- }
- } else {
+ if (!skip_drawing_root_render_pass)
Daniele Castagna 2017/04/19 19:10:36 In the comment you removed it mentioned that calli
reveman 2017/04/19 23:59:03 Yes, that was kind of a hack. Before this we still
DrawRenderPassAndExecuteCopyRequests(root_render_pass);
- }
FinishDrawingFrame();
render_passes_in_draw_order->clear();

Powered by Google App Engine
This is Rietveld 408576698