| OLD | NEW |
| 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 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
| 6 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 public: | 33 public: |
| 34 enum PixelTestType { | 34 enum PixelTestType { |
| 35 PIXEL_TEST_GL, | 35 PIXEL_TEST_GL, |
| 36 PIXEL_TEST_SOFTWARE, | 36 PIXEL_TEST_SOFTWARE, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 LayerTreePixelTest(); | 40 LayerTreePixelTest(); |
| 41 ~LayerTreePixelTest() override; | 41 ~LayerTreePixelTest() override; |
| 42 | 42 |
| 43 // LayerTreeTest overrides. |
| 43 void InitializeSettings(LayerTreeSettings* settings) override; | 44 void InitializeSettings(LayerTreeSettings* settings) override; |
| 44 std::unique_ptr<OutputSurface> CreateOutputSurface() override; | 45 std::unique_ptr<OutputSurface> CreateOutputSurface() override; |
| 45 | 46 |
| 46 virtual std::unique_ptr<CopyOutputRequest> CreateCopyOutputRequest(); | 47 virtual std::unique_ptr<CopyOutputRequest> CreateCopyOutputRequest(); |
| 47 | 48 |
| 48 void ReadbackResult(std::unique_ptr<CopyOutputResult> result); | 49 void ReadbackResult(std::unique_ptr<CopyOutputResult> result); |
| 49 | 50 |
| 50 void BeginTest() override; | 51 void BeginTest() override; |
| 51 void SetupTree() override; | 52 void SetupTree() override; |
| 52 void AfterTest() override; | 53 void AfterTest() override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 74 scoped_refptr<Layer> content_root, | 75 scoped_refptr<Layer> content_root, |
| 75 Layer* target, | 76 Layer* target, |
| 76 base::FilePath file_name); | 77 base::FilePath file_name); |
| 77 | 78 |
| 78 std::unique_ptr<SkBitmap> CopyTextureMailboxToBitmap( | 79 std::unique_ptr<SkBitmap> CopyTextureMailboxToBitmap( |
| 79 const gfx::Size& size, | 80 const gfx::Size& size, |
| 80 const TextureMailbox& texture_mailbox); | 81 const TextureMailbox& texture_mailbox); |
| 81 | 82 |
| 82 void Finish(); | 83 void Finish(); |
| 83 | 84 |
| 85 // Allow tests to enlarge the backing texture for a non-root render pass, to |
| 86 // simulate reusing a larger texture from a previous frame for a new |
| 87 // render pass. This should be called before the output surface is bound. |
| 84 void set_enlarge_texture_amount(const gfx::Size& enlarge_texture_amount) { | 88 void set_enlarge_texture_amount(const gfx::Size& enlarge_texture_amount) { |
| 85 enlarge_texture_amount_ = enlarge_texture_amount; | 89 enlarge_texture_amount_ = enlarge_texture_amount; |
| 86 } | 90 } |
| 87 | 91 |
| 88 // Common CSS colors defined for tests to use. | 92 // Common CSS colors defined for tests to use. |
| 89 static const SkColor kCSSOrange = 0xffffa500; | 93 static const SkColor kCSSOrange = 0xffffa500; |
| 90 static const SkColor kCSSBrown = 0xffa52a2a; | 94 static const SkColor kCSSBrown = 0xffa52a2a; |
| 91 static const SkColor kCSSGreen = 0xff008000; | 95 static const SkColor kCSSGreen = 0xff008000; |
| 92 | 96 |
| 93 gl::DisableNullDrawGLBindings enable_pixel_output_; | 97 gl::DisableNullDrawGLBindings enable_pixel_output_; |
| 94 std::unique_ptr<PixelComparator> pixel_comparator_; | 98 std::unique_ptr<PixelComparator> pixel_comparator_; |
| 95 PixelTestType test_type_; | 99 PixelTestType test_type_; |
| 96 scoped_refptr<Layer> content_root_; | 100 scoped_refptr<Layer> content_root_; |
| 97 Layer* readback_target_; | 101 Layer* readback_target_; |
| 98 base::FilePath ref_file_; | 102 base::FilePath ref_file_; |
| 99 std::unique_ptr<SkBitmap> result_bitmap_; | 103 std::unique_ptr<SkBitmap> result_bitmap_; |
| 100 std::vector<scoped_refptr<TextureLayer>> texture_layers_; | 104 std::vector<scoped_refptr<TextureLayer>> texture_layers_; |
| 101 int pending_texture_mailbox_callbacks_; | 105 int pending_texture_mailbox_callbacks_; |
| 102 gfx::Size enlarge_texture_amount_; | 106 gfx::Size enlarge_texture_amount_; |
| 103 }; | 107 }; |
| 104 | 108 |
| 105 } // namespace cc | 109 } // namespace cc |
| 106 | 110 |
| 107 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 111 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
| OLD | NEW |