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

Unified Diff: cc/trees/clip_node.cc

Issue 2437923002: cc: Change ClipNode::applies_local_clip to a clip_type enum (Closed)
Patch Set: Fix Windows build Created 4 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
« no previous file with comments | « cc/trees/clip_node.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/clip_node.cc
diff --git a/cc/trees/clip_node.cc b/cc/trees/clip_node.cc
index b7d8164381cc91c9e414eaef3c5aaac77dc0d93e..b49263d5a332086920137f9c24b180067dea5dbf 100644
--- a/cc/trees/clip_node.cc
+++ b/cc/trees/clip_node.cc
@@ -4,6 +4,7 @@
#include "base/trace_event/trace_event_argument.h"
#include "cc/base/math_util.h"
+#include "cc/proto/cc_conversions.h"
#include "cc/proto/gfx_conversions.h"
#include "cc/proto/property_tree.pb.h"
#include "cc/trees/clip_node.h"
@@ -14,10 +15,10 @@ ClipNode::ClipNode()
: id(-1),
parent_id(-1),
owner_id(-1),
+ clip_type(ClipType::NONE),
transform_id(-1),
target_transform_id(-1),
target_effect_id(-1),
- applies_local_clip(true),
layer_clipping_uses_only_local_clip(false),
target_is_clipped(false),
layers_are_clipped(false),
@@ -28,13 +29,13 @@ ClipNode::ClipNode(const ClipNode& other) = default;
bool ClipNode::operator==(const ClipNode& other) const {
return id == other.id && parent_id == other.parent_id &&
- owner_id == other.owner_id && clip == other.clip &&
+ owner_id == other.owner_id && clip_type == other.clip_type &&
+ clip == other.clip &&
combined_clip_in_target_space == other.combined_clip_in_target_space &&
clip_in_target_space == other.clip_in_target_space &&
transform_id == other.transform_id &&
target_transform_id == other.target_transform_id &&
target_effect_id == other.target_effect_id &&
- applies_local_clip == other.applies_local_clip &&
layer_clipping_uses_only_local_clip ==
other.layer_clipping_uses_only_local_clip &&
target_is_clipped == other.target_is_clipped &&
@@ -52,6 +53,8 @@ void ClipNode::ToProtobuf(proto::TreeNode* proto) const {
DCHECK(!proto->has_clip_node_data());
proto::ClipNodeData* data = proto->mutable_clip_node_data();
+ data->set_clip_type(ClipNodeTypeToProto(clip_type));
+
RectFToProto(clip, data->mutable_clip());
RectFToProto(combined_clip_in_target_space,
data->mutable_combined_clip_in_target_space());
@@ -60,7 +63,6 @@ void ClipNode::ToProtobuf(proto::TreeNode* proto) const {
data->set_transform_id(transform_id);
data->set_target_transform_id(target_transform_id);
data->set_target_effect_id(target_effect_id);
- data->set_applies_local_clip(applies_local_clip);
data->set_layer_clipping_uses_only_local_clip(
layer_clipping_uses_only_local_clip);
data->set_target_is_clipped(target_is_clipped);
@@ -78,6 +80,7 @@ void ClipNode::FromProtobuf(const proto::TreeNode& proto) {
DCHECK(proto.has_clip_node_data());
const proto::ClipNodeData& data = proto.clip_node_data();
+ clip_type = ClipNodeTypeFromProto(data.clip_type());
clip = ProtoToRectF(data.clip());
combined_clip_in_target_space =
ProtoToRectF(data.combined_clip_in_target_space());
@@ -86,7 +89,6 @@ void ClipNode::FromProtobuf(const proto::TreeNode& proto) {
transform_id = data.transform_id();
target_transform_id = data.target_transform_id();
target_effect_id = data.target_effect_id();
- applies_local_clip = data.applies_local_clip();
layer_clipping_uses_only_local_clip =
data.layer_clipping_uses_only_local_clip();
target_is_clipped = data.target_is_clipped();
@@ -100,11 +102,11 @@ void ClipNode::AsValueInto(base::trace_event::TracedValue* value) const {
value->SetInteger("id", id);
value->SetInteger("parent_id", parent_id);
value->SetInteger("owner_id", owner_id);
+ value->SetInteger("clip_type", static_cast<int>(clip_type));
MathUtil::AddToTracedValue("clip", clip, value);
value->SetInteger("transform_id", transform_id);
value->SetInteger("target_transform_id", target_transform_id);
value->SetInteger("target_effect_id", target_effect_id);
- value->SetBoolean("applies_local_clip", applies_local_clip);
value->SetBoolean("layer_clipping_uses_only_local_clip",
layer_clipping_uses_only_local_clip);
value->SetBoolean("target_is_clipped", target_is_clipped);
« no previous file with comments | « cc/trees/clip_node.h ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698