Commit 4fdba5d4 authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

CompositorElementId: s/ToInternalValue/GetInternalValue/

This is only necessary to eliminate a presubmit error about the use
of the banned method Time::ToInternalValue. No functional change.

BUG=752327
R=chrishtr@chromium.org,vmpstr@chromium.org

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Id0ecab92b4605da1c25398a539be7dc87a250547
Reviewed-on: https://chromium-review.googlesource.com/1135988Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Reviewed-by: default avatarChris Harrelson <chrishtr@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575046}
parent fe587230
......@@ -40,7 +40,7 @@ void ElementId::AddToTracedValue(base::trace_event::TracedValue* res) const {
res->EndDictionary();
}
ElementIdType ElementId::ToInternalValue() const {
ElementIdType ElementId::GetInternalValue() const {
return id_;
}
......
......@@ -60,9 +60,7 @@ struct CC_EXPORT ElementId {
void AddToTracedValue(base::trace_event::TracedValue* res) const;
std::unique_ptr<base::Value> AsValue() const;
// Returns the element id as its underlying representation.
// TODO(wkorman): Remove or rename this method. http://crbug.com/752327
ElementIdType ToInternalValue() const;
ElementIdType GetInternalValue() const;
std::string ToString() const;
......
......@@ -704,7 +704,7 @@ TEST_F(PaintArtifactCompositorTest, EffectTreeConversion) {
const cc::EffectNode& converted_root_effect = *effect_tree.Node(1);
EXPECT_EQ(-1, converted_root_effect.parent_id);
EXPECT_EQ(CompositorElementIdFromUniqueObjectId(1).ToInternalValue(),
EXPECT_EQ(CompositorElementIdFromUniqueObjectId(1).GetInternalValue(),
converted_root_effect.stable_id);
const cc::EffectNode& converted_effect1 = *effect_tree.Node(2);
......
......@@ -125,7 +125,7 @@ void PropertyTreeManager::SetupRootEffectNode() {
static UniqueObjectId unique_id = NewUniqueObjectId();
effect_node.stable_id =
CompositorElementIdFromUniqueObjectId(unique_id).ToInternalValue();
CompositorElementIdFromUniqueObjectId(unique_id).GetInternalValue();
effect_node.transform_id = kRealRootNodeId;
effect_node.clip_id = kSecondaryRootNodeId;
effect_node.has_render_surface = true;
......@@ -325,11 +325,11 @@ void PropertyTreeManager::EmitClipMaskLayer() {
// See PropertyTreeManager::SynthesizeCcEffectsForClipsIfNeeded().
DCHECK_EQ(static_cast<uint64_t>(cc::EffectNode::INVALID_STABLE_ID),
mask_isolation.stable_id);
mask_isolation.stable_id = mask_isolation_id.ToInternalValue();
mask_isolation.stable_id = mask_isolation_id.GetInternalValue();
cc::EffectNode& mask_effect = *GetEffectTree().Node(
GetEffectTree().Insert(cc::EffectNode(), current_effect_id_));
mask_effect.stable_id = mask_effect_id.ToInternalValue();
mask_effect.stable_id = mask_effect_id.GetInternalValue();
mask_effect.clip_id = clip_id;
mask_effect.has_render_surface = true;
mask_effect.blend_mode = SkBlendMode::kDstIn;
......@@ -578,7 +578,7 @@ bool PropertyTreeManager::BuildEffectNodesRecursively(
cc::EffectNode& effect_node = *GetEffectTree().Node(
GetEffectTree().Insert(cc::EffectNode(), current_effect_id_));
effect_node.stable_id =
next_effect->GetCompositorElementId().ToInternalValue();
next_effect->GetCompositorElementId().GetInternalValue();
effect_node.clip_id = output_clip_id;
// Every effect is supposed to have render surface enabled for grouping,
// but we can get away without one if the effect is opacity-only and has only
......
......@@ -54,7 +54,7 @@ CompositorElementIdFromUniqueObjectId(UniqueObjectId id) {
CompositorElementIdNamespace NamespaceFromCompositorElementId(
CompositorElementId element_id) {
return static_cast<CompositorElementIdNamespace>(
element_id.ToInternalValue() %
element_id.GetInternalValue() %
static_cast<uint64_t>(
CompositorElementIdNamespace::kMaxRepresentableNamespaceId));
}
......
......@@ -57,7 +57,7 @@ CompositorElementId PLATFORM_EXPORT CompositorElementIdFromDOMNodeId(DOMNodeId);
// Blink's hash functions with Blink specific data structures.
struct CompositorElementIdHash {
static unsigned GetHash(const CompositorElementId& key) {
return WTF::HashInt(static_cast<cc::ElementIdType>(key.ToInternalValue()));
return WTF::HashInt(static_cast<cc::ElementIdType>(key.GetInternalValue()));
}
static bool Equal(const CompositorElementId& a,
const CompositorElementId& b) {
......
......@@ -11,7 +11,7 @@ namespace blink {
class CompositorElementIdTest : public testing::Test {};
uint64_t IdFromCompositorElementId(CompositorElementId element_id) {
return element_id.ToInternalValue() >> kCompositorNamespaceBitCount;
return element_id.GetInternalValue() >> kCompositorNamespaceBitCount;
}
TEST_F(CompositorElementIdTest, EncodeDecode) {
......
......@@ -719,7 +719,7 @@ CompositorElementId ScrollableArea::GetScrollbarElementId(
? CompositorElementIdNamespace::kHorizontalScrollbar
: CompositorElementIdNamespace::kVerticalScrollbar;
return CompositorElementIdFromUniqueObjectId(
scrollable_element_id.ToInternalValue(), element_id_namespace);
scrollable_element_id.GetInternalValue(), element_id_namespace);
}
void ScrollableArea::Trace(blink::Visitor* visitor) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment