| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 namespace cc { | 23 namespace cc { |
| 24 class CopyOutputRequest; | 24 class CopyOutputRequest; |
| 25 class CopyOutputResult; | 25 class CopyOutputResult; |
| 26 class LayerTreeHost; | 26 class LayerTreeHost; |
| 27 class PixelComparator; | 27 class PixelComparator; |
| 28 class SolidColorLayer; | 28 class SolidColorLayer; |
| 29 class TextureLayer; | 29 class TextureLayer; |
| 30 class TextureMailbox; | 30 class TextureMailbox; |
| 31 | 31 |
| 32 class LayerTreePixelTest : public LayerTreeTest { | 32 class LayerTreePixelTest : public LayerTreeTest { |
| 33 public: |
| 34 enum PixelTestType { |
| 35 PIXEL_TEST_GL, |
| 36 PIXEL_TEST_SOFTWARE, |
| 37 }; |
| 38 |
| 33 protected: | 39 protected: |
| 34 LayerTreePixelTest(); | 40 LayerTreePixelTest(); |
| 35 virtual ~LayerTreePixelTest(); | 41 virtual ~LayerTreePixelTest(); |
| 36 | 42 |
| 37 scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override; | 43 scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) override; |
| 38 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override; | 44 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override; |
| 39 | 45 |
| 40 virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest(); | 46 virtual scoped_ptr<CopyOutputRequest> CreateCopyOutputRequest(); |
| 41 | 47 |
| 42 void ReadbackResult(scoped_ptr<CopyOutputResult> result); | 48 void ReadbackResult(scoped_ptr<CopyOutputResult> result); |
| 43 | 49 |
| 44 void BeginTest() override; | 50 void BeginTest() override; |
| 45 void SetupTree() override; | 51 void SetupTree() override; |
| 46 void AfterTest() override; | 52 void AfterTest() override; |
| 47 void EndTest() override; | 53 void EndTest() override; |
| 48 | 54 |
| 49 void TryEndTest(); | 55 void TryEndTest(); |
| 50 | 56 |
| 51 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(const gfx::Rect& rect, | 57 scoped_refptr<SolidColorLayer> CreateSolidColorLayer(const gfx::Rect& rect, |
| 52 SkColor color); | 58 SkColor color); |
| 53 scoped_refptr<SolidColorLayer> CreateSolidColorLayerWithBorder( | 59 scoped_refptr<SolidColorLayer> CreateSolidColorLayerWithBorder( |
| 54 const gfx::Rect& rect, | 60 const gfx::Rect& rect, |
| 55 SkColor color, | 61 SkColor color, |
| 56 int border_width, | 62 int border_width, |
| 57 SkColor border_color); | 63 SkColor border_color); |
| 58 scoped_refptr<TextureLayer> CreateTextureLayer(const gfx::Rect& rect, | 64 scoped_refptr<TextureLayer> CreateTextureLayer(const gfx::Rect& rect, |
| 59 const SkBitmap& bitmap); | 65 const SkBitmap& bitmap); |
| 60 | 66 |
| 61 enum PixelTestType { | |
| 62 PIXEL_TEST_GL, | |
| 63 PIXEL_TEST_SOFTWARE, | |
| 64 }; | |
| 65 | |
| 66 void RunPixelTest(PixelTestType type, | 67 void RunPixelTest(PixelTestType type, |
| 67 scoped_refptr<Layer> content_root, | 68 scoped_refptr<Layer> content_root, |
| 68 base::FilePath file_name); | 69 base::FilePath file_name); |
| 69 | 70 |
| 70 void RunPixelTestWithReadbackTarget(PixelTestType type, | 71 void RunPixelTestWithReadbackTarget(PixelTestType type, |
| 71 scoped_refptr<Layer> content_root, | 72 scoped_refptr<Layer> content_root, |
| 72 Layer* target, | 73 Layer* target, |
| 73 base::FilePath file_name); | 74 base::FilePath file_name); |
| 74 | 75 |
| 75 scoped_ptr<SkBitmap> CopyTextureMailboxToBitmap( | 76 scoped_ptr<SkBitmap> CopyTextureMailboxToBitmap( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 99 base::FilePath ref_file_; | 100 base::FilePath ref_file_; |
| 100 scoped_ptr<SkBitmap> result_bitmap_; | 101 scoped_ptr<SkBitmap> result_bitmap_; |
| 101 std::vector<scoped_refptr<TextureLayer>> texture_layers_; | 102 std::vector<scoped_refptr<TextureLayer>> texture_layers_; |
| 102 int pending_texture_mailbox_callbacks_; | 103 int pending_texture_mailbox_callbacks_; |
| 103 bool impl_side_painting_; | 104 bool impl_side_painting_; |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace cc | 107 } // namespace cc |
| 107 | 108 |
| 108 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 109 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
| OLD | NEW |