summaryrefslogtreecommitdiffstats
path: root/cc/layers/layer.cc
diff options
context:
space:
mode:
authorenne <enne@chromium.org>2016-01-04 12:34:22 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-04 20:35:46 +0000
commit75e2fba8610567c6b903ecd929707660570d3197 (patch)
treecd87604327502566b98378c18de64c8ee012c717 /cc/layers/layer.cc
parent4a331a6a10955897f23624a6732d495c7bb22fe3 (diff)
downloadchromium_src-75e2fba8610567c6b903ecd929707660570d3197.zip
chromium_src-75e2fba8610567c6b903ecd929707660570d3197.tar.gz
chromium_src-75e2fba8610567c6b903ecd929707660570d3197.tar.bz2
cc: turn on strict paint property checking
This is in preparation for getting rid of paint properties entirely. Turned on the setting always, turned DCHECKs to CHECKs to get better canary input, and deleted tests that no longer make sense. I plan on reverting this patch if this CHECK fires on any page. R=danakj@chromium.org,chrishtr@chromium.org CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1514743002 Cr-Commit-Position: refs/heads/master@{#367360}
Diffstat (limited to 'cc/layers/layer.cc')
-rw-r--r--cc/layers/layer.cc88
1 files changed, 44 insertions, 44 deletions
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 9d82b58..19b8a95 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -294,7 +294,7 @@ void Layer::AddChild(scoped_refptr<Layer> child) {
}
void Layer::InsertChild(scoped_refptr<Layer> child, size_t index) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
child->RemoveFromParent();
AddDrawableDescendants(child->NumDescendantsThatDrawContent() +
(child->DrawsContent() ? 1 : 0));
@@ -307,7 +307,7 @@ void Layer::InsertChild(scoped_refptr<Layer> child, size_t index) {
}
void Layer::RemoveFromParent() {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (parent_)
parent_->RemoveChildOrDependent(this);
}
@@ -344,7 +344,7 @@ void Layer::RemoveChildOrDependent(Layer* child) {
void Layer::ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer) {
DCHECK(reference);
DCHECK_EQ(reference->parent(), this);
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (reference == new_layer.get())
return;
@@ -366,7 +366,7 @@ void Layer::ReplaceChild(Layer* reference, scoped_refptr<Layer> new_layer) {
}
void Layer::SetBounds(const gfx::Size& size) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (bounds() == size)
return;
bounds_ = size;
@@ -393,7 +393,7 @@ Layer* Layer::RootLayer() {
}
void Layer::RemoveAllChildren() {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
while (children_.size()) {
Layer* layer = children_[0].get();
DCHECK_EQ(this, layer->parent());
@@ -402,7 +402,7 @@ void Layer::RemoveAllChildren() {
}
void Layer::SetChildren(const LayerList& children) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (children == children_)
return;
@@ -421,7 +421,7 @@ bool Layer::HasAncestor(const Layer* ancestor) const {
void Layer::RequestCopyOfOutput(
scoped_ptr<CopyOutputRequest> request) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
bool had_no_copy_requests = copy_requests_.empty();
if (void* source = request->source()) {
auto it = std::find_if(copy_requests_.begin(), copy_requests_.end(),
@@ -451,7 +451,7 @@ void Layer::UpdateNumCopyRequestsForSubtree(int delta) {
}
void Layer::SetBackgroundColor(SkColor background_color) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (background_color_ == background_color)
return;
background_color_ = background_color;
@@ -478,7 +478,7 @@ SkColor Layer::SafeOpaqueBackgroundColor() const {
}
void Layer::SetMasksToBounds(bool masks_to_bounds) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (masks_to_bounds_ == masks_to_bounds)
return;
masks_to_bounds_ = masks_to_bounds;
@@ -486,7 +486,7 @@ void Layer::SetMasksToBounds(bool masks_to_bounds) {
}
void Layer::SetMaskLayer(Layer* mask_layer) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (mask_layer_.get() == mask_layer)
return;
if (mask_layer_.get()) {
@@ -504,7 +504,7 @@ void Layer::SetMaskLayer(Layer* mask_layer) {
}
void Layer::SetReplicaLayer(Layer* layer) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (replica_layer_.get() == layer)
return;
if (replica_layer_.get()) {
@@ -521,7 +521,7 @@ void Layer::SetReplicaLayer(Layer* layer) {
}
void Layer::SetFilters(const FilterOperations& filters) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (filters_ == filters)
return;
filters_ = filters;
@@ -546,7 +546,7 @@ bool Layer::HasPotentiallyRunningFilterAnimation() const {
}
void Layer::SetBackgroundFilters(const FilterOperations& filters) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (background_filters_ == filters)
return;
background_filters_ = filters;
@@ -554,7 +554,7 @@ void Layer::SetBackgroundFilters(const FilterOperations& filters) {
}
void Layer::SetOpacity(float opacity) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (opacity_ == opacity)
return;
opacity_ = opacity;
@@ -583,7 +583,7 @@ bool Layer::OpacityCanAnimateOnImplThread() const {
}
void Layer::SetBlendMode(SkXfermode::Mode blend_mode) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (blend_mode_ == blend_mode)
return;
@@ -632,7 +632,7 @@ void Layer::SetBlendMode(SkXfermode::Mode blend_mode) {
}
void Layer::SetIsRootForIsolatedGroup(bool root) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (is_root_for_isolated_group_ == root)
return;
is_root_for_isolated_group_ = root;
@@ -640,7 +640,7 @@ void Layer::SetIsRootForIsolatedGroup(bool root) {
}
void Layer::SetContentsOpaque(bool opaque) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (contents_opaque_ == opaque)
return;
contents_opaque_ = opaque;
@@ -648,7 +648,7 @@ void Layer::SetContentsOpaque(bool opaque) {
}
void Layer::SetPosition(const gfx::PointF& position) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (position_ == position)
return;
position_ = position;
@@ -696,7 +696,7 @@ bool Are2dAxisAligned(const gfx::Transform& a,
}
void Layer::SetTransform(const gfx::Transform& transform) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (transform_ == transform)
return;
@@ -733,7 +733,7 @@ void Layer::SetTransform(const gfx::Transform& transform) {
}
void Layer::SetTransformOrigin(const gfx::Point3F& transform_origin) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (transform_origin_ == transform_origin)
return;
transform_origin_ = transform_origin;
@@ -823,7 +823,7 @@ bool Layer::ScrollOffsetAnimationWasInterrupted() const {
}
void Layer::SetScrollParent(Layer* parent) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (scroll_parent_ == parent)
return;
@@ -853,7 +853,7 @@ void Layer::RemoveScrollChild(Layer* child) {
}
void Layer::SetClipParent(Layer* ancestor) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (clip_parent_ == ancestor)
return;
@@ -885,7 +885,7 @@ void Layer::RemoveClipChild(Layer* child) {
}
void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (scroll_offset_ == scroll_offset)
return;
@@ -923,7 +923,7 @@ gfx::Vector2dF Layer::ScrollCompensationAdjustment() const {
void Layer::SetScrollOffsetFromImplSide(
const gfx::ScrollOffset& scroll_offset) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
// This function only gets called during a BeginMainFrame, so there
// is no need to call SetNeedsUpdate here.
DCHECK(layer_tree_host_ && layer_tree_host_->CommitRequested());
@@ -954,7 +954,7 @@ void Layer::SetScrollOffsetFromImplSide(
}
void Layer::SetScrollClipLayerId(int clip_layer_id) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (scroll_clip_layer_id_ == clip_layer_id)
return;
scroll_clip_layer_id_ = clip_layer_id;
@@ -962,7 +962,7 @@ void Layer::SetScrollClipLayerId(int clip_layer_id) {
}
void Layer::SetUserScrollable(bool horizontal, bool vertical) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (user_scrollable_horizontal_ == horizontal &&
user_scrollable_vertical_ == vertical)
return;
@@ -972,7 +972,7 @@ void Layer::SetUserScrollable(bool horizontal, bool vertical) {
}
void Layer::SetShouldScrollOnMainThread(bool should_scroll_on_main_thread) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (should_scroll_on_main_thread_ == should_scroll_on_main_thread)
return;
should_scroll_on_main_thread_ = should_scroll_on_main_thread;
@@ -980,7 +980,7 @@ void Layer::SetShouldScrollOnMainThread(bool should_scroll_on_main_thread) {
}
void Layer::SetHaveWheelEventHandlers(bool have_wheel_event_handlers) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (have_wheel_event_handlers_ == have_wheel_event_handlers)
return;
@@ -989,7 +989,7 @@ void Layer::SetHaveWheelEventHandlers(bool have_wheel_event_handlers) {
}
void Layer::SetHaveScrollEventHandlers(bool have_scroll_event_handlers) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (have_scroll_event_handlers_ == have_scroll_event_handlers)
return;
have_scroll_event_handlers_ = have_scroll_event_handlers;
@@ -997,7 +997,7 @@ void Layer::SetHaveScrollEventHandlers(bool have_scroll_event_handlers) {
}
void Layer::SetNonFastScrollableRegion(const Region& region) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (non_fast_scrollable_region_ == region)
return;
non_fast_scrollable_region_ = region;
@@ -1005,7 +1005,7 @@ void Layer::SetNonFastScrollableRegion(const Region& region) {
}
void Layer::SetTouchEventHandlerRegion(const Region& region) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (touch_event_handler_region_ == region)
return;
@@ -1014,7 +1014,7 @@ void Layer::SetTouchEventHandlerRegion(const Region& region) {
}
void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (scroll_blocks_on_ == scroll_blocks_on)
return;
scroll_blocks_on_ = scroll_blocks_on;
@@ -1022,7 +1022,7 @@ void Layer::SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) {
}
void Layer::SetForceRenderSurface(bool force) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (force_render_surface_ == force)
return;
force_render_surface_ = force;
@@ -1030,7 +1030,7 @@ void Layer::SetForceRenderSurface(bool force) {
}
void Layer::SetDoubleSided(bool double_sided) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (double_sided_ == double_sided)
return;
double_sided_ = double_sided;
@@ -1038,7 +1038,7 @@ void Layer::SetDoubleSided(bool double_sided) {
}
void Layer::Set3dSortingContextId(int id) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (id == sorting_context_id_)
return;
sorting_context_id_ = id;
@@ -1046,7 +1046,7 @@ void Layer::Set3dSortingContextId(int id) {
}
void Layer::SetTransformTreeIndex(int index) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (transform_tree_index_ == index)
return;
transform_tree_index_ = index;
@@ -1063,7 +1063,7 @@ int Layer::transform_tree_index() const {
}
void Layer::SetClipTreeIndex(int index) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (clip_tree_index_ == index)
return;
clip_tree_index_ = index;
@@ -1080,7 +1080,7 @@ int Layer::clip_tree_index() const {
}
void Layer::SetEffectTreeIndex(int index) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (effect_tree_index_ == index)
return;
effect_tree_index_ = index;
@@ -1104,7 +1104,7 @@ void Layer::InvalidatePropertyTreesIndices() {
}
void Layer::SetShouldFlattenTransform(bool should_flatten) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (should_flatten_transform_ == should_flatten)
return;
should_flatten_transform_ = should_flatten;
@@ -1112,7 +1112,7 @@ void Layer::SetShouldFlattenTransform(bool should_flatten) {
}
void Layer::SetIsDrawable(bool is_drawable) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (is_drawable_ == is_drawable)
return;
@@ -1121,7 +1121,7 @@ void Layer::SetIsDrawable(bool is_drawable) {
}
void Layer::SetHideLayerAndSubtree(bool hide) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (hide_layer_and_subtree_ == hide)
return;
@@ -1163,7 +1163,7 @@ void Layer::SetIsContainerForFixedPositionLayers(bool container) {
}
void Layer::SetPositionConstraint(const LayerPositionConstraint& constraint) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (position_constraint_ == constraint)
return;
position_constraint_ = constraint;
@@ -1974,7 +1974,7 @@ void Layer::SetFrameTimingRequests(
}
void Layer::SetElementId(uint64_t id) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (element_id_ == id)
return;
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),
@@ -1984,7 +1984,7 @@ void Layer::SetElementId(uint64_t id) {
}
void Layer::SetMutableProperties(uint32_t properties) {
- DCHECK(IsPropertyChangeAllowed());
+ CHECK(IsPropertyChangeAllowed());
if (mutable_properties_ == properties)
return;
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("compositor-worker"),