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

Unified Diff: cc/layers/layer_impl.cc

Issue 16211002: Skip drawing unsupported layers in forced software mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase on r203584 Created 7 years, 7 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/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 9404e96a6158ae2c5d6349830488104e1db29e44..4d92c192e503d3a38db4206ae706ff5a71027333 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -55,9 +55,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
is_container_for_fixed_position_layers_(false),
draw_depth_(0.f),
compositing_reasons_(kCompositingReasonUnknown),
-#ifndef NDEBUG
- between_will_draw_and_did_draw_(false),
-#endif
+ current_draw_mode_(DRAW_MODE_NONE),
horizontal_scrollbar_layer_(NULL),
vertical_scrollbar_layer_(NULL) {
DCHECK_GT(layer_id_, 0);
@@ -70,9 +68,7 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
}
LayerImpl::~LayerImpl() {
-#ifndef NDEBUG
- DCHECK(!between_will_draw_and_did_draw_);
-#endif
+ DCHECK_EQ(DRAW_MODE_NONE, current_draw_mode_);
layer_tree_impl_->UnregisterLayer(this);
layer_animation_controller_->RemoveValueObserver(this);
@@ -147,19 +143,18 @@ scoped_ptr<SharedQuadState> LayerImpl::CreateSharedQuadState() const {
return state.Pass();
}
-void LayerImpl::WillDraw(ResourceProvider* resource_provider) {
-#ifndef NDEBUG
+bool LayerImpl::WillDraw(DrawMode draw_mode,
+ ResourceProvider* resource_provider) {
// WillDraw/DidDraw must be matched.
- DCHECK(!between_will_draw_and_did_draw_);
- between_will_draw_and_did_draw_ = true;
-#endif
+ DCHECK_NE(DRAW_MODE_NONE, draw_mode);
+ DCHECK_EQ(DRAW_MODE_NONE, current_draw_mode_);
+ current_draw_mode_ = draw_mode;
+ return true;
}
void LayerImpl::DidDraw(ResourceProvider* resource_provider) {
-#ifndef NDEBUG
- DCHECK(between_will_draw_and_did_draw_);
- between_will_draw_and_did_draw_ = false;
-#endif
+ DCHECK_NE(DRAW_MODE_NONE, current_draw_mode_);
+ current_draw_mode_ = DRAW_MODE_NONE;
}
bool LayerImpl::ShowDebugBorders() const {

Powered by Google App Engine
This is Rietveld 408576698