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

Side by Side Diff: cc/test/fake_tile_manager.cc

Issue 1885873002: cc: Rename TileTaskClient interface to RasterBufferProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_schedule
Patch Set: Removed patch dependency. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/raster/zero_copy_tile_task_worker_pool.cc ('k') | cc/tiles/gpu_image_decode_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/fake_tile_manager.h" 5 #include "cc/test/fake_tile_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
11 #include <limits> 11 #include <limits>
12 12
13 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "cc/raster/raster_buffer.h" 15 #include "cc/raster/raster_buffer.h"
16 #include "cc/raster/tile_task_runner.h" 16 #include "cc/raster/tile_task_runner.h"
17 17
18 namespace cc { 18 namespace cc {
19 19
20 namespace { 20 namespace {
21 21
22 class FakeTileTaskRunnerImpl : public TileTaskRunner, public TileTaskClient { 22 class FakeTileTaskRunnerImpl : public TileTaskRunner,
23 public RasterBufferProvider {
23 public: 24 public:
24 // Overridden from TileTaskRunner: 25 // Overridden from TileTaskRunner:
25 void Shutdown() override {} 26 void Shutdown() override {}
26 void ScheduleTasks(TaskGraph* graph) override { 27 void ScheduleTasks(TaskGraph* graph) override {
27 for (const auto& node : graph->nodes) { 28 for (const auto& node : graph->nodes) {
28 RasterTask* task = static_cast<RasterTask*>(node.task); 29 RasterTask* task = static_cast<RasterTask*>(node.task);
29 30
30 task->WillSchedule(); 31 task->WillSchedule();
31 task->ScheduleOnOriginThread(this); 32 task->ScheduleOnOriginThread(this);
32 task->DidSchedule(); 33 task->DidSchedule();
(...skipping 12 matching lines...) Expand all
45 task->DidComplete(); 46 task->DidComplete();
46 } 47 }
47 completed_tasks_.clear(); 48 completed_tasks_.clear();
48 } 49 }
49 ResourceFormat GetResourceFormat(bool must_support_alpha) const override { 50 ResourceFormat GetResourceFormat(bool must_support_alpha) const override {
50 return RGBA_8888; 51 return RGBA_8888;
51 } 52 }
52 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override { 53 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override {
53 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); 54 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
54 } 55 }
56 RasterBufferProvider* AsRasterBufferProvider() override { return this; }
55 57
56 // Overridden from TileTaskClient: 58 // Overridden from RasterBufferProvider:
57 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( 59 std::unique_ptr<RasterBuffer> AcquireBufferForRaster(
58 const Resource* resource, 60 const Resource* resource,
59 uint64_t resource_content_id, 61 uint64_t resource_content_id,
60 uint64_t previous_content_id) override { 62 uint64_t previous_content_id) override {
61 return nullptr; 63 return nullptr;
62 } 64 }
63 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override {} 65 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override {}
64 66
65 private: 67 private:
66 RasterTask::Vector completed_tasks_; 68 RasterTask::Vector completed_tasks_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 102 }
101 103
102 void FakeTileManager::Release(Tile* tile) { 104 void FakeTileManager::Release(Tile* tile) {
103 TileManager::Release(tile); 105 TileManager::Release(tile);
104 106
105 FreeResourcesForReleasedTiles(); 107 FreeResourcesForReleasedTiles();
106 CleanUpReleasedTiles(); 108 CleanUpReleasedTiles();
107 } 109 }
108 110
109 } // namespace cc 111 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/zero_copy_tile_task_worker_pool.cc ('k') | cc/tiles/gpu_image_decode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698