Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_TEST_LAYER_TREE_PIXEL_RESOURCE_TEST_H_ | |
| 6 #define CC_TEST_LAYER_TREE_PIXEL_RESOURCE_TEST_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "cc/test/layer_tree_pixel_test.h" | |
| 10 | |
| 11 namespace cc { | |
| 12 | |
| 13 class LayerTreeHostImpl; | |
| 14 class RasterWorkerPool; | |
| 15 class ResourcePool; | |
| 16 | |
| 17 // Enumerate the various combinations of renderer, resource pool, staging | |
| 18 // texture type, and drawing texture types. Not all of the combinations | |
| 19 // are possible (or worth testing independently), so this is the minimal | |
| 20 // list to hit all codepaths. | |
| 21 enum PixelResourceTestCase { | |
| 22 SOFTWARE, | |
| 23 GL_GPU_RASTER_2D_DRAW, | |
| 24 GL_ONE_COPY_2D_STAGING_2D_DRAW, | |
| 25 GL_ONE_COPY_RECT_STAGING_2D_DRAW, | |
| 26 GL_ONE_COPY_EXTERNAL_STAGING_2D_DRAW, | |
| 27 GL_ZERO_COPY_2D_DRAW, | |
| 28 GL_ZERO_COPY_RECT_DRAW, | |
| 29 GL_ZERO_COPY_EXTERNAL_DRAW, | |
| 30 GL_ASYNC_UPLOAD_2D_DRAW, | |
|
reveman
2014/10/23 20:39:27
What's the naming convention here?
GL_(raster-wor
enne (OOO)
2014/10/24 22:21:28
Don't agree. See comment below.
| |
| 31 NUM_PIXEL_RESOURCE_TEST_CASES, | |
|
reveman
2014/10/23 20:39:27
If you're going to keep this then consider using "
enne (OOO)
2014/10/24 22:21:28
Removed.
| |
| 32 }; | |
| 33 | |
| 34 class LayerTreeHostPixelResourceTest : public LayerTreePixelTest { | |
| 35 public: | |
| 36 explicit LayerTreeHostPixelResourceTest(PixelResourceTestCase test_case); | |
| 37 | |
| 38 void CreateResourceAndRasterWorkerPool( | |
| 39 LayerTreeHostImpl* host_impl, | |
| 40 scoped_ptr<RasterWorkerPool>* raster_worker_pool, | |
| 41 scoped_ptr<ResourcePool>* resource_pool, | |
| 42 scoped_ptr<ResourcePool>* staging_resource_pool) override; | |
| 43 | |
| 44 void RunPixelResourceTest(scoped_refptr<Layer> content_root, | |
| 45 base::FilePath file_name); | |
| 46 | |
| 47 enum ResourcePoolOption { | |
|
reveman
2014/10/23 20:39:27
ResourcePoolOption, uh? Should it be RasterizeOpti
enne (OOO)
2014/10/24 22:21:28
Sure.
| |
| 48 RESOURCE_POOL_BITMAP_RASTER_WORKER, | |
| 49 RESOURCE_POOL_GPU_RASTER, | |
| 50 RESOURCE_POOL_ZERO_COPY, | |
| 51 RESOURCE_POOL_ONE_COPY, | |
| 52 RESOURCE_POOL_PIXEL_BUFFER_RASTER, | |
|
reveman
2014/10/23 20:39:27
Can you make these names better align with RasterW
enne (OOO)
2014/10/24 22:21:28
I named them identically to the class names, e.g.
| |
| 53 }; | |
| 54 | |
| 55 protected: | |
| 56 unsigned staging_texture_target_; | |
| 57 unsigned draw_texture_target_; | |
|
reveman
2014/10/23 20:39:27
I don't think we should have both staging and draw
enne (OOO)
2014/10/24 22:21:28
I disagree. raster_texture_target just hides the
reveman
2014/10/27 17:19:04
To pixel test draw target support independent of a
enne (OOO)
2014/10/27 17:56:22
Maybe you should have mentioned that several revie
reveman
2014/10/27 18:42:44
Testing all supported draw targets sgtm. Testing a
| |
| 58 ResourcePoolOption resource_pool_option_; | |
| 59 | |
| 60 private: | |
| 61 PixelResourceTestCase test_case_; | |
| 62 }; | |
| 63 | |
| 64 #define INSTANTIATE_PIXEL_RESOURCE_TEST_CASE_P(framework_name) \ | |
| 65 INSTANTIATE_TEST_CASE_P( \ | |
| 66 PixelResourceTest, \ | |
| 67 framework_name, \ | |
| 68 ::testing::Values(SOFTWARE, \ | |
| 69 GL_GPU_RASTER_2D_DRAW, \ | |
| 70 GL_ONE_COPY_2D_STAGING_2D_DRAW, \ | |
| 71 GL_ONE_COPY_RECT_STAGING_2D_DRAW, \ | |
| 72 GL_ONE_COPY_EXTERNAL_STAGING_2D_DRAW, \ | |
| 73 GL_ZERO_COPY_2D_DRAW, \ | |
| 74 GL_ZERO_COPY_RECT_DRAW, \ | |
| 75 GL_ZERO_COPY_EXTERNAL_DRAW, \ | |
| 76 GL_ASYNC_UPLOAD_2D_DRAW)) | |
| 77 | |
| 78 class ParameterizedPixelResourceTest | |
| 79 : public LayerTreeHostPixelResourceTest, | |
| 80 public ::testing::WithParamInterface<PixelResourceTestCase> { | |
| 81 public: | |
| 82 ParameterizedPixelResourceTest(); | |
| 83 }; | |
| 84 | |
| 85 } // namespace cc | |
| 86 | |
| 87 #endif // CC_TEST_LAYER_TREE_PIXEL_RESOURCE_TEST_H_ | |
| OLD | NEW |