Skip to content

Commit

Permalink
[cc] cleanup: re-arrange some file locations in cc/scheduler
Browse files Browse the repository at this point in the history
* Move rolling_time_delta_history.[cc|h] to cc/base
* Move texture_uploader.[cc|h] to cc/resources

R=enne@chromium.org
BUG=340190
TEST=cc_unittests

Review URL: https://codereview.chromium.org/130173007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248685 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
simonhong@chromium.org committed Feb 4, 2014
1 parent fe1afdb commit eade06d
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <cmath>

#include "cc/scheduler/rolling_time_delta_history.h"
#include "cc/base/rolling_time_delta_history.h"

namespace cc {

RollingTimeDeltaHistory::RollingTimeDeltaHistory(size_t max_size)
: max_size_(max_size) {
}
: max_size_(max_size) {}

RollingTimeDeltaHistory::~RollingTimeDeltaHistory() {
}
RollingTimeDeltaHistory::~RollingTimeDeltaHistory() {}

void RollingTimeDeltaHistory::InsertSample(base::TimeDelta time) {
if (max_size_ == 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_
#define CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_
#ifndef CC_BASE_ROLLING_TIME_DELTA_HISTORY_H_
#define CC_BASE_ROLLING_TIME_DELTA_HISTORY_H_

#include <deque>
#include <set>
Expand Down Expand Up @@ -41,4 +41,4 @@ class CC_EXPORT RollingTimeDeltaHistory {

} // namespace cc

#endif // CC_SCHEDULER_ROLLING_TIME_DELTA_HISTORY_H_
#endif // CC_BASE_ROLLING_TIME_DELTA_HISTORY_H_
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/rolling_time_delta_history.h"
#include "cc/base/rolling_time_delta_history.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace cc {
Expand Down
8 changes: 4 additions & 4 deletions cc/cc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
'base/ref_counted_managed.h',
'base/region.cc',
'base/region.h',
'base/rolling_time_delta_history.cc',
'base/rolling_time_delta_history.h',
'base/scoped_ptr_algorithm.h',
'base/scoped_ptr_deque.h',
'base/scoped_ptr_vector.h',
Expand Down Expand Up @@ -388,6 +390,8 @@
'resources/texture_mailbox.h',
'resources/texture_mailbox_deleter.cc',
'resources/texture_mailbox_deleter.h',
'resources/texture_uploader.cc',
'resources/texture_uploader.h',
'resources/tile.cc',
'resources/tile.h',
'resources/tile_manager.cc',
Expand All @@ -408,16 +412,12 @@
'scheduler/draw_swap_readback_result.h',
'scheduler/frame_rate_controller.cc',
'scheduler/frame_rate_controller.h',
'scheduler/rolling_time_delta_history.cc',
'scheduler/rolling_time_delta_history.h',
'scheduler/scheduler.cc',
'scheduler/scheduler.h',
'scheduler/scheduler_settings.cc',
'scheduler/scheduler_settings.h',
'scheduler/scheduler_state_machine.cc',
'scheduler/scheduler_state_machine.h',
'scheduler/texture_uploader.cc',
'scheduler/texture_uploader.h',
'scheduler/time_source.h',
'trees/blocking_task_runner.cc',
'trees/blocking_task_runner.h',
Expand Down
4 changes: 2 additions & 2 deletions cc/cc_tests.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'base/float_quad_unittest.cc',
'base/math_util_unittest.cc',
'base/region_unittest.cc',
'base/rolling_time_delta_history_unittest.cc',
'base/scoped_ptr_vector_unittest.cc',
'base/tiling_data_unittest.cc',
'base/util_unittest.cc',
Expand Down Expand Up @@ -70,15 +71,14 @@
'resources/scoped_resource_unittest.cc',
'resources/task_graph_runner_unittest.cc',
'resources/texture_mailbox_deleter_unittest.cc',
'resources/texture_uploader_unittest.cc',
'resources/tile_manager_unittest.cc',
'resources/tile_priority_unittest.cc',
'resources/video_resource_updater_unittest.cc',
'scheduler/delay_based_time_source_unittest.cc',
'scheduler/frame_rate_controller_unittest.cc',
'scheduler/rolling_time_delta_history_unittest.cc',
'scheduler/scheduler_state_machine_unittest.cc',
'scheduler/scheduler_unittest.cc',
'scheduler/texture_uploader_unittest.cc',
'test/layer_tree_json_parser_unittest.cc',
'test/test_web_graphics_context_3d_unittest.cc',
'trees/damage_tracker_unittest.cc',
Expand Down
1 change: 0 additions & 1 deletion cc/layers/nine_patch_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "cc/resources/resource_provider.h"
#include "cc/resources/resource_update_queue.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/scheduler/texture_uploader.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_output_surface.h"
Expand Down
1 change: 0 additions & 1 deletion cc/layers/ui_resource_layer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "cc/resources/resource_provider.h"
#include "cc/resources/resource_update_queue.h"
#include "cc/resources/scoped_ui_resource.h"
#include "cc/scheduler/texture_uploader.h"
#include "cc/test/fake_layer_tree_host.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_output_surface.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/output/output_surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "cc/base/cc_export.h"
#include "cc/base/rolling_time_delta_history.h"
#include "cc/output/context_provider.h"
#include "cc/output/software_output_device.h"
#include "cc/scheduler/frame_rate_controller.h"
#include "cc/scheduler/rolling_time_delta_history.h"

namespace base { class SingleThreadTaskRunner; }

Expand Down
2 changes: 1 addition & 1 deletion cc/resources/resource_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "cc/resources/platform_color.h"
#include "cc/resources/returned_resource.h"
#include "cc/resources/shared_bitmap_manager.h"
#include "cc/resources/texture_uploader.h"
#include "cc/resources/transferable_resource.h"
#include "cc/scheduler/texture_uploader.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/texture_uploader.h"
#include "cc/resources/texture_uploader.h"

#include <algorithm>
#include <vector>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_SCHEDULER_TEXTURE_UPLOADER_H_
#define CC_SCHEDULER_TEXTURE_UPLOADER_H_
#ifndef CC_RESOURCES_TEXTURE_UPLOADER_H_
#define CC_RESOURCES_TEXTURE_UPLOADER_H_

#include <set>

Expand Down Expand Up @@ -66,12 +66,8 @@ class CC_EXPORT TextureUploader {
bool IsPending();
unsigned Value();
size_t TexturesUploaded();
void mark_as_non_blocking() {
is_non_blocking_ = true;
}
bool is_non_blocking() const {
return is_non_blocking_;
}
void mark_as_non_blocking() { is_non_blocking_ = true; }
bool is_non_blocking() const { return is_non_blocking_; }

private:
explicit Query(gpu::gles2::GLES2Interface* gl);
Expand Down Expand Up @@ -119,4 +115,4 @@ class CC_EXPORT TextureUploader {

} // namespace cc

#endif // CC_SCHEDULER_TEXTURE_UPLOADER_H_
#endif // CC_RESOURCES_TEXTURE_UPLOADER_H_
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2012 The Chromium Authors. All rights reserved.
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/scheduler/texture_uploader.h"
#include "cc/resources/texture_uploader.h"

#include "cc/base/util.h"
#include "cc/resources/prioritized_resource.h"
Expand Down Expand Up @@ -147,12 +147,8 @@ void UploadTexture(TextureUploader* uploader,
ResourceFormat format,
const gfx::Size& size,
const uint8* data) {
uploader->Upload(data,
gfx::Rect(size),
gfx::Rect(size),
gfx::Vector2d(),
format,
size);
uploader->Upload(
data, gfx::Rect(size), gfx::Rect(size), gfx::Vector2d(), format, size);
}

TEST(TextureUploaderTest, NumBlockingUploads) {
Expand Down
1 change: 0 additions & 1 deletion cc/test/tiled_layer_test_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "cc/resources/prioritized_resource.h"
#include "cc/resources/resource_provider.h"
#include "cc/resources/resource_update_queue.h"
#include "cc/scheduler/texture_uploader.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"

Expand Down
1 change: 0 additions & 1 deletion cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#include "cc/resources/texture_mailbox_deleter.h"
#include "cc/resources/ui_resource_bitmap.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "cc/scheduler/texture_uploader.h"
#include "cc/trees/damage_tracker.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_host_common.h"
Expand Down
2 changes: 1 addition & 1 deletion cc/trees/thread_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include "base/time/time.h"
#include "cc/animation/animation_events.h"
#include "cc/base/completion_event.h"
#include "cc/base/rolling_time_delta_history.h"
#include "cc/resources/resource_update_controller.h"
#include "cc/scheduler/rolling_time_delta_history.h"
#include "cc/scheduler/scheduler.h"
#include "cc/trees/layer_tree_host_impl.h"
#include "cc/trees/proxy.h"
Expand Down

0 comments on commit eade06d

Please sign in to comment.