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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1394263004: android webview: allow cc to fail hardware draw (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + expand test Created 5 years, 2 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/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index e1aae1a6a36a5c37a98f3e6286119390ea718905..cca67d0571747f452a6054121aacc227d39df184 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -365,14 +365,14 @@ bool LayerTreeHostImpl::CanDraw() const {
DCHECK(output_surface_);
// TODO(boliu): Make draws without root_layer work and move this below
- // draw_and_swap_full_viewport_every_frame check. Tracked in crbug.com/264967.
+ // |resourceless_software_draw_| check. Tracked in crbug.com/264967.
if (!active_tree_->root_layer()) {
TRACE_EVENT_INSTANT0("cc", "LayerTreeHostImpl::CanDraw no root layer",
TRACE_EVENT_SCOPE_THREAD);
return false;
}
- if (output_surface_->capabilities().draw_and_swap_full_viewport_every_frame)
+ if (resourceless_software_draw_)
return true;
if (DrawViewportSize().IsEmpty()) {
@@ -765,8 +765,7 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
TRACE_EVENT0("cc",
"LayerTreeHostImpl::CalculateRenderPasses::EmptyDamageRect");
frame->has_no_damage = true;
- DCHECK(!output_surface_->capabilities()
- .draw_and_swap_full_viewport_every_frame);
+ DCHECK(!resourceless_software_draw_);
return DRAW_SUCCESS;
}
@@ -945,11 +944,11 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses(
draw_result = DRAW_ABORTED_MISSING_HIGH_RES_CONTENT;
}
- // When this capability is set we don't have control over the surface the
+ // When resourceless software draw, we don't have control over the surface the
danakj 2015/10/22 18:49:23 "When doing a resourceless..."
boliu 2015/10/22 21:50:08 Done.
// compositor draws to, so even though the frame may not be complete, the
// previous frame has already been potentially lost, so an incomplete frame is
// better than nothing, so this takes highest precidence.
- if (output_surface_->capabilities().draw_and_swap_full_viewport_every_frame)
+ if (resourceless_software_draw_)
draw_result = DRAW_SUCCESS;
#if DCHECK_IS_ON()
@@ -1090,8 +1089,7 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) {
DrawResult draw_result = CalculateRenderPasses(frame);
if (draw_result != DRAW_SUCCESS) {
- DCHECK(!output_surface_->capabilities()
- .draw_and_swap_full_viewport_every_frame);
+ DCHECK(!resourceless_software_draw_);
return draw_result;
}
@@ -1448,6 +1446,11 @@ void LayerTreeHostImpl::SetExternalDrawConstraints(
SetFullRootLayerDamage();
SetNeedsRedraw();
}
+
+ if (resourceless_software_draw_changed) {
+ client_->OnResourcelessSoftareDrawStateChanged(resourceless_software_draw);
danakj 2015/10/22 18:49:23 The only thing I can see maybe being better is tha
boliu 2015/10/22 18:58:08 Yep. Always reset back to false after the OnDraw
brianderson 2015/10/22 20:53:35 I'd vote for an argument as well. I didn't realize
+ client_->OnCanDrawStateChanged(CanDraw());
+ }
}
void LayerTreeHostImpl::SetNeedsRedrawRect(const gfx::Rect& damage_rect) {
@@ -1556,8 +1559,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame) {
if (frame->has_no_damage) {
TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoDamage", TRACE_EVENT_SCOPE_THREAD);
- DCHECK(!output_surface_->capabilities()
- .draw_and_swap_full_viewport_every_frame);
+ DCHECK(!resourceless_software_draw_);
return;
}

Powered by Google App Engine
This is Rietveld 408576698