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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 2154473004: Add a sanity DCHECK when constructing a UIResourceRequest. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a check that we're deleting when no bitmap is passed to the constructor. Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3663 matching lines...) Expand 10 before | Expand all | Expand 10 after
3674 return; 3674 return;
3675 3675
3676 debug_state_ = new_debug_state; 3676 debug_state_ = new_debug_state;
3677 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); 3677 UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy());
3678 SetFullRootLayerDamage(); 3678 SetFullRootLayerDamage();
3679 } 3679 }
3680 3680
3681 void LayerTreeHostImpl::CreateUIResource(UIResourceId uid, 3681 void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
3682 const UIResourceBitmap& bitmap) { 3682 const UIResourceBitmap& bitmap) {
3683 DCHECK_GT(uid, 0); 3683 DCHECK_GT(uid, 0);
3684 DCHECK(&bitmap);
vmpstr 2016/07/15 21:29:23 This shouldn't be here. We should be DCHECKing at
Donn Denman 2016/07/15 22:05:56 Removed.
3684 3685
3685 // Allow for multiple creation requests with the same UIResourceId. The 3686 // Allow for multiple creation requests with the same UIResourceId. The
3686 // previous resource is simply deleted. 3687 // previous resource is simply deleted.
3687 ResourceId id = ResourceIdForUIResource(uid); 3688 ResourceId id = ResourceIdForUIResource(uid);
3688 if (id) 3689 if (id)
3689 DeleteUIResource(uid); 3690 DeleteUIResource(uid);
3690 3691
3691 ResourceFormat format = resource_provider_->best_texture_format(); 3692 ResourceFormat format = resource_provider_->best_texture_format();
3692 switch (bitmap.GetFormat()) { 3693 switch (bitmap.GetFormat()) {
3693 case UIResourceBitmap::RGBA8: 3694 case UIResourceBitmap::RGBA8:
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
4023 return task_runner_provider_->HasImplThread(); 4024 return task_runner_provider_->HasImplThread();
4024 } 4025 }
4025 4026
4026 bool LayerTreeHostImpl::CommitToActiveTree() const { 4027 bool LayerTreeHostImpl::CommitToActiveTree() const {
4027 // In single threaded mode we skip the pending tree and commit directly to the 4028 // In single threaded mode we skip the pending tree and commit directly to the
4028 // active tree. 4029 // active tree.
4029 return !task_runner_provider_->HasImplThread(); 4030 return !task_runner_provider_->HasImplThread();
4030 } 4031 }
4031 4032
4032 } // namespace cc 4033 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698