Skip to content

Commit

Permalink
Revert of cc: Add image decode queue functionality to image manager. …
Browse files Browse the repository at this point in the history
…(patchset chromium#12 id:220001 of https://codereview.chromium.org/2537683002/ )

Reason for revert:
Hoping to fix build/test errors such as
https://uberchromegw.corp.google.com/i/chromium.win/builders/Win%207%20Tests%20x64%20%281%29/builds/19947

-- sheriff.

Original issue's description:
> cc: Add image decode queue functionality to image manager.
>
> This patch adds an ability to request an image decode from
> the compositor. The caller should specify which image
> (SkImage) to decode and a callback. In return, it gets an
> id. When the image is decoded, the callback is issued with
> this id. The decode is then kept alive for 2 compositor
> frames.
>
> Right now, only unittests are using this functionality.
>
> R=enne@chromium.org, ericrk@chromium.org, danakj@chromium.org
> CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
>
> Review-Url: https://codereview.chromium.org/2537683002
> Cr-Commit-Position: refs/heads/master@{#443085}
> Committed: https://chromium.googlesource.com/chromium/src/+/bb991d41668aa0f37aa6d6712e3bf9b52a5480ae

TBR=enne@chromium.org,danakj@chromium.org,ericrk@chromium.org,vmpstr@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2631453002
Cr-Commit-Position: refs/heads/master@{#443125}
  • Loading branch information
dschuyler authored and Commit bot committed Jan 12, 2017
1 parent 6cc842d commit 1e09c6d
Show file tree
Hide file tree
Showing 28 changed files with 93 additions and 1,197 deletions.
3 changes: 0 additions & 3 deletions cc/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,6 @@ cc_component("cc") {
"scheduler/scheduler_state_machine.cc",
"scheduler/scheduler_state_machine.h",
"scheduler/video_frame_controller.h",
"tiles/decoded_image_tracker.cc",
"tiles/decoded_image_tracker.h",
"tiles/eviction_tile_priority_queue.cc",
"tiles/eviction_tile_priority_queue.h",
"tiles/gpu_image_decode_cache.cc",
Expand Down Expand Up @@ -887,7 +885,6 @@ cc_test("cc_unittests") {
"test/mock_helper_unittest.cc",
"test/ordered_simple_task_runner_unittest.cc",
"test/test_web_graphics_context_3d_unittest.cc",
"tiles/decoded_image_tracker_unittest.cc",
"tiles/gpu_image_decode_cache_unittest.cc",
"tiles/image_controller_unittest.cc",
"tiles/mipmap_util_unittest.cc",
Expand Down
2 changes: 0 additions & 2 deletions cc/playback/image_hijack_canvas_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class MockImageDecodeCache : public ImageDecodeCache {
MOCK_METHOD0(ReduceCacheUsage, void());
MOCK_METHOD1(SetShouldAggressivelyFreeResources,
void(bool aggressively_free_resources));
MOCK_METHOD2(GetOutOfRasterDecodeTaskForImageAndRef,
bool(const DrawImage& image, scoped_refptr<TileTask>* task));
};

TEST(ImageHijackCanvasTest, NonLazyImagesSkipped) {
Expand Down
21 changes: 0 additions & 21 deletions cc/raster/task.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ TaskState::~TaskState() {
"CANCELED state.";
}

bool TaskState::IsNew() const {
return value_ == Value::NEW;
}

bool TaskState::IsScheduled() const {
return value_ == Value::SCHEDULED;
}
Expand All @@ -42,23 +38,6 @@ void TaskState::Reset() {
value_ = Value::NEW;
}

std::string TaskState::ToString() const {
switch (value_) {
case Value::NEW:
return "NEW";
case Value::SCHEDULED:
return "SCHEDULED";
case Value::RUNNING:
return "RUNNING";
case Value::FINISHED:
return "FINISHED";
case Value::CANCELED:
return "CANCELED";
}
NOTREACHED();
return "";
}

void TaskState::DidSchedule() {
DCHECK(value_ == Value::NEW)
<< "Task should be in NEW state to get scheduled.";
Expand Down
4 changes: 0 additions & 4 deletions cc/raster/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include <stdint.h>

#include <string>
#include <vector>

#include "base/memory/ref_counted.h"
Expand Down Expand Up @@ -39,7 +38,6 @@ class Task;
// └─────────┘ ╚══════════╝
class CC_EXPORT TaskState {
public:
bool IsNew() const;
bool IsScheduled() const;
bool IsRunning() const;
bool IsFinished() const;
Expand All @@ -55,8 +53,6 @@ class CC_EXPORT TaskState {
void DidFinish();
void DidCancel();

std::string ToString() const;

private:
friend class Task;

Expand Down
3 changes: 1 addition & 2 deletions cc/test/fake_layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ FakeLayerTreeHostImpl::FakeLayerTreeHostImpl(
&stats_instrumentation_,
task_graph_runner,
AnimationHost::CreateForTesting(ThreadInstance::IMPL),
0,
nullptr),
0),
notify_tile_state_changed_called_(false) {
// Explicitly clear all debug settings.
SetDebugState(LayerTreeDebugState());
Expand Down
18 changes: 16 additions & 2 deletions cc/test/fake_tile_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,32 @@ base::LazyInstance<FakeRasterBufferProviderImpl> g_fake_raster_buffer_provider =

} // namespace

FakeTileManager::FakeTileManager(TileManagerClient* client)
: TileManager(client,
base::ThreadTaskRunnerHandle::Get().get(),
std::numeric_limits<size_t>::max(),
false /* use_partial_raster */,
false /* check_tile_priority_inversion */),
image_decode_cache_(
ResourceFormat::RGBA_8888,
LayerTreeSettings().software_decoded_image_budget_bytes) {
SetResources(
nullptr, &image_decode_cache_, g_synchronous_task_graph_runner.Pointer(),
g_fake_raster_buffer_provider.Pointer(),
std::numeric_limits<size_t>::max(), false /* use_gpu_rasterization */);
SetTileTaskManagerForTesting(base::MakeUnique<FakeTileTaskManagerImpl>());
}

FakeTileManager::FakeTileManager(TileManagerClient* client,
ResourcePool* resource_pool)
: TileManager(client,
base::ThreadTaskRunnerHandle::Get().get(),
nullptr,
std::numeric_limits<size_t>::max(),
false /* use_partial_raster */,
false /* check_tile_priority_inversion */),
image_decode_cache_(
ResourceFormat::RGBA_8888,
LayerTreeSettings().software_decoded_image_budget_bytes) {
SetDecodedImageTracker(&decoded_image_tracker_);
SetResources(resource_pool, &image_decode_cache_,
g_synchronous_task_graph_runner.Pointer(),
g_fake_raster_buffer_provider.Pointer(),
Expand Down
5 changes: 2 additions & 3 deletions cc/test/fake_tile_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace cc {

class FakeTileManager : public TileManager {
public:
FakeTileManager(TileManagerClient* client,
ResourcePool* resource_pool = nullptr);
explicit FakeTileManager(TileManagerClient* client);
FakeTileManager(TileManagerClient* client, ResourcePool* resource_pool);
~FakeTileManager() override;

bool HasBeenAssignedMemory(Tile* tile);
Expand All @@ -27,7 +27,6 @@ class FakeTileManager : public TileManager {

private:
SoftwareImageDecodeCache image_decode_cache_;
DecodedImageTracker decoded_image_tracker_;
};

} // namespace cc
Expand Down
3 changes: 1 addition & 2 deletions cc/test/layer_tree_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class LayerTreeHostImplForTesting : public LayerTreeHostImpl {
stats_instrumentation,
task_graph_runner,
AnimationHost::CreateForTesting(ThreadInstance::IMPL),
0,
nullptr),
0),
test_hooks_(test_hooks),
block_notify_ready_to_activate_for_testing_(false),
notify_ready_to_activate_was_blocked_(false) {}
Expand Down
50 changes: 0 additions & 50 deletions cc/tiles/decoded_image_tracker.cc

This file was deleted.

56 changes: 0 additions & 56 deletions cc/tiles/decoded_image_tracker.h

This file was deleted.

90 changes: 0 additions & 90 deletions cc/tiles/decoded_image_tracker_unittest.cc

This file was deleted.

Loading

0 comments on commit 1e09c6d

Please sign in to comment.