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

Side by Side Diff: cc/raster/tile_task_worker_pool_unittest.cc

Issue 1362663002: cc: Remove PicturePile and PicturePileImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/raster/tile_task_worker_pool.h" 5 #include "cc/raster/tile_task_worker_pool.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "cc/base/unique_notifier.h" 14 #include "cc/base/unique_notifier.h"
15 #include "cc/playback/picture_pile.h"
16 #include "cc/playback/picture_pile_impl.h"
17 #include "cc/raster/bitmap_tile_task_worker_pool.h" 15 #include "cc/raster/bitmap_tile_task_worker_pool.h"
18 #include "cc/raster/gpu_rasterizer.h" 16 #include "cc/raster/gpu_rasterizer.h"
19 #include "cc/raster/gpu_tile_task_worker_pool.h" 17 #include "cc/raster/gpu_tile_task_worker_pool.h"
20 #include "cc/raster/one_copy_tile_task_worker_pool.h" 18 #include "cc/raster/one_copy_tile_task_worker_pool.h"
21 #include "cc/raster/raster_buffer.h" 19 #include "cc/raster/raster_buffer.h"
22 #include "cc/raster/tile_task_runner.h" 20 #include "cc/raster/tile_task_runner.h"
23 #include "cc/raster/zero_copy_tile_task_worker_pool.h" 21 #include "cc/raster/zero_copy_tile_task_worker_pool.h"
24 #include "cc/resources/resource_pool.h" 22 #include "cc/resources/resource_pool.h"
25 #include "cc/resources/resource_provider.h" 23 #include "cc/resources/resource_provider.h"
26 #include "cc/resources/scoped_resource.h" 24 #include "cc/resources/scoped_resource.h"
25 #include "cc/test/fake_display_list_raster_source.h"
27 #include "cc/test/fake_output_surface.h" 26 #include "cc/test/fake_output_surface.h"
28 #include "cc/test/fake_output_surface_client.h" 27 #include "cc/test/fake_output_surface_client.h"
29 #include "cc/test/fake_picture_pile_impl.h"
30 #include "cc/test/fake_resource_provider.h" 28 #include "cc/test/fake_resource_provider.h"
31 #include "cc/test/test_gpu_memory_buffer_manager.h" 29 #include "cc/test/test_gpu_memory_buffer_manager.h"
32 #include "cc/test/test_shared_bitmap_manager.h" 30 #include "cc/test/test_shared_bitmap_manager.h"
33 #include "cc/test/test_task_graph_runner.h" 31 #include "cc/test/test_task_graph_runner.h"
34 #include "cc/test/test_web_graphics_context_3d.h" 32 #include "cc/test/test_web_graphics_context_3d.h"
35 #include "gpu/GLES2/gl2extchromium.h" 33 #include "gpu/GLES2/gl2extchromium.h"
36 #include "testing/gtest/include/gtest/gtest.h" 34 #include "testing/gtest/include/gtest/gtest.h"
37 35
38 namespace cc { 36 namespace cc {
39 namespace { 37 namespace {
(...skipping 12 matching lines...) Expand all
52 public: 50 public:
53 typedef base::Callback<void(const RasterSource::SolidColorAnalysis& analysis, 51 typedef base::Callback<void(const RasterSource::SolidColorAnalysis& analysis,
54 bool was_canceled)> Reply; 52 bool was_canceled)> Reply;
55 53
56 TestRasterTaskImpl(const Resource* resource, 54 TestRasterTaskImpl(const Resource* resource,
57 const Reply& reply, 55 const Reply& reply,
58 ImageDecodeTask::Vector* dependencies) 56 ImageDecodeTask::Vector* dependencies)
59 : RasterTask(dependencies), 57 : RasterTask(dependencies),
60 resource_(resource), 58 resource_(resource),
61 reply_(reply), 59 reply_(reply),
62 picture_pile_(FakePicturePileImpl::CreateEmptyPile(gfx::Size(1, 1), 60 picture_raster_source_(
63 gfx::Size(1, 1))) {} 61 FakeDisplayListRasterSource::CreateFilled(gfx::Size(1, 1))) {}
64 62
65 // Overridden from Task: 63 // Overridden from Task:
66 void RunOnWorkerThread() override { 64 void RunOnWorkerThread() override {
67 uint64_t new_content_id = 0; 65 uint64_t new_content_id = 0;
68 raster_buffer_->Playback(picture_pile_.get(), gfx::Rect(1, 1), 66 raster_buffer_->Playback(picture_raster_source_.get(), gfx::Rect(1, 1),
69 gfx::Rect(1, 1), new_content_id, 1.f, true); 67 gfx::Rect(1, 1), new_content_id, 1.f, true);
70 } 68 }
71 69
72 // Overridden from TileTask: 70 // Overridden from TileTask:
73 void ScheduleOnOriginThread(TileTaskClient* client) override { 71 void ScheduleOnOriginThread(TileTaskClient* client) override {
74 // The raster buffer has no tile ids associated with it for partial update, 72 // The raster buffer has no tile ids associated with it for partial update,
75 // so doesn't need to provide a valid dirty rect. 73 // so doesn't need to provide a valid dirty rect.
76 raster_buffer_ = client->AcquireBufferForRaster(resource_, 0, 0); 74 raster_buffer_ = client->AcquireBufferForRaster(resource_, 0, 0);
77 } 75 }
78 void CompleteOnOriginThread(TileTaskClient* client) override { 76 void CompleteOnOriginThread(TileTaskClient* client) override {
79 client->ReleaseBufferForRaster(raster_buffer_.Pass()); 77 client->ReleaseBufferForRaster(raster_buffer_.Pass());
80 reply_.Run(RasterSource::SolidColorAnalysis(), !HasFinishedRunning()); 78 reply_.Run(RasterSource::SolidColorAnalysis(), !HasFinishedRunning());
81 } 79 }
82 80
83 protected: 81 protected:
84 ~TestRasterTaskImpl() override {} 82 ~TestRasterTaskImpl() override {}
85 83
86 private: 84 private:
87 const Resource* resource_; 85 const Resource* resource_;
88 const Reply reply_; 86 const Reply reply_;
89 scoped_ptr<RasterBuffer> raster_buffer_; 87 scoped_ptr<RasterBuffer> raster_buffer_;
90 scoped_refptr<PicturePileImpl> picture_pile_; 88 scoped_refptr<RasterSource> picture_raster_source_;
danakj 2015/09/22 21:52:15 nit: just raster_source_?
vmpstr 2015/09/22 22:57:49 Done.
91 89
92 DISALLOW_COPY_AND_ASSIGN(TestRasterTaskImpl); 90 DISALLOW_COPY_AND_ASSIGN(TestRasterTaskImpl);
93 }; 91 };
94 92
95 class BlockingTestRasterTaskImpl : public TestRasterTaskImpl { 93 class BlockingTestRasterTaskImpl : public TestRasterTaskImpl {
96 public: 94 public:
97 BlockingTestRasterTaskImpl(const Resource* resource, 95 BlockingTestRasterTaskImpl(const Resource* resource,
98 const Reply& reply, 96 const Reply& reply,
99 base::Lock* lock, 97 base::Lock* lock,
100 ImageDecodeTask::Vector* dependencies) 98 ImageDecodeTask::Vector* dependencies)
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 404
407 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests, 405 INSTANTIATE_TEST_CASE_P(TileTaskWorkerPoolTests,
408 TileTaskWorkerPoolTest, 406 TileTaskWorkerPoolTest,
409 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY, 407 ::testing::Values(TILE_TASK_WORKER_POOL_TYPE_ZERO_COPY,
410 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY, 408 TILE_TASK_WORKER_POOL_TYPE_ONE_COPY,
411 TILE_TASK_WORKER_POOL_TYPE_GPU, 409 TILE_TASK_WORKER_POOL_TYPE_GPU,
412 TILE_TASK_WORKER_POOL_TYPE_BITMAP)); 410 TILE_TASK_WORKER_POOL_TYPE_BITMAP));
413 411
414 } // namespace 412 } // namespace
415 } // namespace cc 413 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698