Skip to content

Commit

Permalink
cc/blimp: Proto Cleanup.
Browse files Browse the repository at this point in the history
Remove all unused protos and serialization code.

BUG=648442
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Review-Url: https://codereview.chromium.org/2493853002
Cr-Commit-Position: refs/heads/master@{#431782}
  • Loading branch information
khushalsagar authored and Commit bot committed Nov 12, 2016
1 parent 3d9470f commit 4762e7c
Show file tree
Hide file tree
Showing 68 changed files with 37 additions and 2,898 deletions.
12 changes: 0 additions & 12 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,8 @@ component("cc") {
"proto/cc_conversions.h",
"proto/gfx_conversions.cc",
"proto/gfx_conversions.h",
"proto/gpu_conversions.cc",
"proto/gpu_conversions.h",
"proto/skia_conversions.cc",
"proto/skia_conversions.h",
"proto/synced_property_conversions.cc",
"proto/synced_property_conversions.h",
"quads/content_draw_quad_base.cc",
"quads/content_draw_quad_base.h",
"quads/debug_border_draw_quad.cc",
Expand Down Expand Up @@ -449,7 +445,6 @@ component("cc") {
"scheduler/begin_frame_source.h",
"scheduler/begin_frame_tracker.cc",
"scheduler/begin_frame_tracker.h",
"scheduler/commit_earlyout_reason.cc",
"scheduler/commit_earlyout_reason.h",
"scheduler/compositor_timing_history.cc",
"scheduler/compositor_timing_history.h",
Expand Down Expand Up @@ -853,7 +848,6 @@ test("cc_unittests") {
"blimp/layer_tree_host_unittest_serialization.cc",
"blimp/picture_data_conversions_unittest.cc",
"blimp/synced_property_remote_unittest.cc",
"debug/layer_tree_debug_state_unittest.cc",
"debug/micro_benchmark_controller_unittest.cc",
"debug/rendering_stats_unittest.cc",
"input/browser_controls_offset_manager_unittest.cc",
Expand Down Expand Up @@ -900,10 +894,8 @@ test("cc_unittests") {
"output/filter_operations_unittest.cc",
"output/gl_renderer_unittest.cc",
"output/layer_quad_unittest.cc",
"output/managed_memory_policy_unittest.cc",
"output/overlay_unittest.cc",
"output/renderer_pixeltest.cc",
"output/renderer_settings_unittest.cc",
"output/shader_unittest.cc",
"output/software_renderer_unittest.cc",
"output/texture_mailbox_deleter_unittest.cc",
Expand All @@ -914,9 +906,7 @@ test("cc_unittests") {
"proto/base_conversions_unittest.cc",
"proto/cc_conversions_unittest.cc",
"proto/gfx_conversions_unittest.cc",
"proto/gpu_conversions_unittest.cc",
"proto/skia_conversions_unittest.cc",
"proto/synced_property_conversions_unittest.cc",
"quads/draw_polygon_unittest.cc",
"quads/draw_quad_unittest.cc",
"quads/render_pass_unittest.cc",
Expand All @@ -932,7 +922,6 @@ test("cc_unittests") {
"resources/scoped_resource_unittest.cc",
"resources/video_resource_updater_unittest.cc",
"scheduler/begin_frame_source_unittest.cc",
"scheduler/commit_earlyout_reason_unittest.cc",
"scheduler/compositor_timing_history_unittest.cc",
"scheduler/delay_based_time_source_unittest.cc",
"scheduler/scheduler_state_machine_unittest.cc",
Expand Down Expand Up @@ -976,7 +965,6 @@ test("cc_unittests") {
"trees/occlusion_tracker_unittest.cc",
"trees/occlusion_unittest.cc",
"trees/property_tree_unittest.cc",
"trees/proxy_common_unittest.cc",
"trees/swap_promise_manager_unittest.cc",
"trees/tree_synchronizer_unittest.cc",

Expand Down
11 changes: 0 additions & 11 deletions cc/animation/element_id.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "base/trace_event/trace_event_argument.h"
#include "base/values.h"
#include "cc/proto/element_id.pb.h"

namespace cc {

Expand Down Expand Up @@ -46,16 +45,6 @@ std::unique_ptr<base::Value> ElementId::AsValue() const {
return std::move(res);
}

void ElementId::ToProtobuf(proto::ElementId* proto) const {
proto->set_primary_id(primaryId);
proto->set_secondary_id(secondaryId);
}

void ElementId::FromProtobuf(const proto::ElementId& proto) {
primaryId = proto.primary_id();
secondaryId = proto.secondary_id();
}

size_t ElementIdHash::operator()(ElementId key) const {
return base::HashInts(key.primaryId, key.secondaryId);
}
Expand Down
11 changes: 0 additions & 11 deletions cc/animation/element_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,6 @@ class TracedValue;

namespace cc {

namespace proto {
class ElementId;
} // namespace proto

// ------------------------------*IMPORTANT*---------------------------------
// ElementId has a corresponding proto defined in cc/proto/element_id.proto.
// When making any changes here, but sure to update the proto.

// An "element" is really an animation target. It retains the name element to be
// symmetric with ElementAnimations and blink::ElementAnimations, but is not
// in fact tied to the notion of a blink element. It is also not associated with
Expand All @@ -57,9 +49,6 @@ struct CC_EXPORT ElementId {
void AddToTracedValue(base::trace_event::TracedValue* res) const;
std::unique_ptr<base::Value> AsValue() const;

void ToProtobuf(proto::ElementId* proto) const;
void FromProtobuf(const proto::ElementId& proto);

// The compositor treats this as an opaque handle and should not know how to
// interpret these bits. Non-blink cc clients typically operate in terms of
// layers and may set this value to match the client's layer id.
Expand Down
4 changes: 0 additions & 4 deletions cc/blimp/compositor_state_deserializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,6 @@ scoped_refptr<Layer> CompositorStateDeserializer::GetLayerAndAddToNewMap(
layer_node.id(), orientation, thumb_thickness, track_start,
is_left_side_vertical_scrollbar, Layer::LayerIdLabels::INVALID_ID);
} break;
case proto::LayerNode::HEADS_UP_DISPLAY_LAYER:
// TODO(khushalsagar): Remove this from proto.
NOTREACHED();
break;
case proto::LayerNode::PUSH_PROPERTIES_COUNTING_LAYER:
// PUSH_PROPERTIES_COUNTING_LAYER is for testing only.
layer_data.layer =
Expand Down
39 changes: 0 additions & 39 deletions cc/debug/layer_tree_debug_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "cc/debug/layer_tree_debug_state.h"

#include "base/logging.h"
#include "cc/proto/layer_tree_debug_state.pb.h"

namespace cc {

Expand Down Expand Up @@ -56,44 +55,6 @@ bool LayerTreeDebugState::ShowMemoryStats() const {
return show_fps_counter;
}

void LayerTreeDebugState::ToProtobuf(proto::LayerTreeDebugState* proto) const {
proto->set_show_fps_counter(show_fps_counter);
proto->set_show_debug_borders(show_debug_borders);
proto->set_show_paint_rects(show_paint_rects);
proto->set_show_property_changed_rects(show_property_changed_rects);
proto->set_show_surface_damage_rects(show_surface_damage_rects);
proto->set_show_screen_space_rects(show_screen_space_rects);
proto->set_show_touch_event_handler_rects(show_touch_event_handler_rects);
proto->set_show_wheel_event_handler_rects(show_wheel_event_handler_rects);
proto->set_show_scroll_event_handler_rects(show_scroll_event_handler_rects);
proto->set_show_non_fast_scrollable_rects(show_non_fast_scrollable_rects);
proto->set_show_layer_animation_bounds_rects(
show_layer_animation_bounds_rects);
proto->set_slow_down_raster_scale_factor(slow_down_raster_scale_factor);
proto->set_rasterize_only_visible_content(rasterize_only_visible_content);
proto->set_show_picture_borders(show_picture_borders);
proto->set_record_rendering_stats(record_rendering_stats_);
}

void LayerTreeDebugState::FromProtobuf(
const proto::LayerTreeDebugState& proto) {
show_fps_counter = proto.show_fps_counter();
show_debug_borders = proto.show_debug_borders();
show_paint_rects = proto.show_paint_rects();
show_property_changed_rects = proto.show_property_changed_rects();
show_surface_damage_rects = proto.show_surface_damage_rects();
show_screen_space_rects = proto.show_screen_space_rects();
show_touch_event_handler_rects = proto.show_touch_event_handler_rects();
show_wheel_event_handler_rects = proto.show_wheel_event_handler_rects();
show_scroll_event_handler_rects = proto.show_scroll_event_handler_rects();
show_non_fast_scrollable_rects = proto.show_non_fast_scrollable_rects();
show_layer_animation_bounds_rects = proto.show_layer_animation_bounds_rects();
slow_down_raster_scale_factor = proto.slow_down_raster_scale_factor();
rasterize_only_visible_content = proto.rasterize_only_visible_content();
show_picture_borders = proto.show_picture_borders();
record_rendering_stats_ = proto.record_rendering_stats();
}

bool LayerTreeDebugState::Equal(const LayerTreeDebugState& a,
const LayerTreeDebugState& b) {
return (
Expand Down
3 changes: 0 additions & 3 deletions cc/debug/layer_tree_debug_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class CC_EXPORT LayerTreeDebugState {
bool ShowHudRects() const;
bool ShowMemoryStats() const;

void ToProtobuf(proto::LayerTreeDebugState* proto) const;
void FromProtobuf(const proto::LayerTreeDebugState& proto);

static bool Equal(const LayerTreeDebugState& a, const LayerTreeDebugState& b);
static LayerTreeDebugState Unite(const LayerTreeDebugState& a,
const LayerTreeDebugState& b);
Expand Down
62 changes: 0 additions & 62 deletions cc/debug/layer_tree_debug_state_unittest.cc

This file was deleted.

6 changes: 0 additions & 6 deletions cc/layers/heads_up_display_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "base/trace_event/trace_event.h"
#include "cc/layers/heads_up_display_layer_impl.h"
#include "cc/proto/layer.pb.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_settings.h"

Expand Down Expand Up @@ -62,11 +61,6 @@ std::unique_ptr<LayerImpl> HeadsUpDisplayLayer::CreateLayerImpl(
return HeadsUpDisplayLayerImpl::Create(tree_impl, id());
}

void HeadsUpDisplayLayer::SetTypeForProtoSerialization(
proto::LayerNode* proto) const {
proto->set_type(proto::LayerNode::HEADS_UP_DISPLAY_LAYER);
}

void HeadsUpDisplayLayer::PushPropertiesTo(LayerImpl* layer) {
Layer::PushPropertiesTo(layer);
TRACE_EVENT0("cc", "HeadsUpDisplayLayer::PushPropertiesTo");
Expand Down
2 changes: 0 additions & 2 deletions cc/layers/heads_up_display_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class CC_EXPORT HeadsUpDisplayLayer : public Layer {

std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;

void SetTypeForProtoSerialization(proto::LayerNode* proto) const override;

// Layer overrides.
void PushPropertiesTo(LayerImpl* layer) override;

Expand Down
55 changes: 0 additions & 55 deletions cc/output/begin_frame_args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "base/trace_event/trace_event_argument.h"
#include "cc/proto/base_conversions.h"
#include "cc/proto/begin_main_frame_and_commit_state.pb.h"

namespace cc {

Expand All @@ -25,44 +24,6 @@ const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) {
return "???";
}

void BeginFrameArgs::BeginFrameArgsTypeToProtobuf(
proto::BeginFrameArgs* proto) const {
switch (type) {
case BeginFrameArgs::INVALID:
proto->set_type(proto::BeginFrameArgs::INVALID);
return;
case BeginFrameArgs::NORMAL:
proto->set_type(proto::BeginFrameArgs::NORMAL);
return;
case BeginFrameArgs::MISSED:
proto->set_type(proto::BeginFrameArgs::MISSED);
return;
case BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX:
proto->set_type(proto::BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX);
return;
}
NOTREACHED();
}

void BeginFrameArgs::BeginFrameArgsTypeFromProtobuf(
const proto::BeginFrameArgs& proto) {
switch (proto.type()) {
case proto::BeginFrameArgs::INVALID:
type = BeginFrameArgs::INVALID;
return;
case proto::BeginFrameArgs::NORMAL:
type = BeginFrameArgs::NORMAL;
return;
case proto::BeginFrameArgs::MISSED:
type = BeginFrameArgs::MISSED;
return;
case proto::BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX:
type = BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX;
return;
}
NOTREACHED();
}

BeginFrameArgs::BeginFrameArgs()
: frame_time(base::TimeTicks()),
deadline(base::TimeTicks()),
Expand Down Expand Up @@ -118,22 +79,6 @@ void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const {
state->SetBoolean("on_critical_path", on_critical_path);
}

void BeginFrameArgs::ToProtobuf(proto::BeginFrameArgs* proto) const {
proto->set_frame_time(TimeTicksToProto(frame_time));
proto->set_deadline(TimeTicksToProto(deadline));
proto->set_interval(interval.ToInternalValue());
BeginFrameArgsTypeToProtobuf(proto);
proto->set_on_critical_path(on_critical_path);
}

void BeginFrameArgs::FromProtobuf(const proto::BeginFrameArgs& proto) {
frame_time = ProtoToTimeTicks(proto.frame_time());
deadline = ProtoToTimeTicks(proto.deadline());
interval = base::TimeDelta::FromInternalValue(proto.interval());
BeginFrameArgsTypeFromProtobuf(proto);
on_critical_path = proto.on_critical_path();
}

// This is a hard-coded deadline adjustment that assumes 60Hz, to be used in
// cases where a good estimated draw time is not known. Using 1/3 of the vsync
// as the default adjustment gives the Browser the last 1/3 of a frame to
Expand Down
9 changes: 0 additions & 9 deletions cc/output/begin_frame_args.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ class TracedValue;

namespace cc {

namespace proto {
class BeginFrameArgs;
}

struct CC_EXPORT BeginFrameArgs {
enum BeginFrameArgsType {
INVALID,
Expand All @@ -52,8 +48,6 @@ struct CC_EXPORT BeginFrameArgs {
BEGIN_FRAME_ARGS_TYPE_MAX,
};
static const char* TypeToString(BeginFrameArgsType type);
void BeginFrameArgsTypeToProtobuf(proto::BeginFrameArgs* proto) const;
void BeginFrameArgsTypeFromProtobuf(const proto::BeginFrameArgs& proto);

// Creates an invalid set of values.
BeginFrameArgs();
Expand Down Expand Up @@ -87,9 +81,6 @@ struct CC_EXPORT BeginFrameArgs {
std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
void AsValueInto(base::trace_event::TracedValue* dict) const;

void ToProtobuf(proto::BeginFrameArgs* proto) const;
void FromProtobuf(const proto::BeginFrameArgs& proto);

base::TimeTicks frame_time;
base::TimeTicks deadline;
base::TimeDelta interval;
Expand Down
Loading

0 comments on commit 4762e7c

Please sign in to comment.