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 #include <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "cc/resources/scoped_release_callback.h" |
10 #include "cc/test/layer_tree_test.h" | 11 #include "cc/test/layer_tree_test.h" |
11 | 12 |
12 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 13 #ifndef CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
13 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 14 #define CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
14 | 15 |
15 class SkBitmap; | 16 class SkBitmap; |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 class CopyOutputRequest; | 19 class CopyOutputRequest; |
19 class CopyOutputResult; | 20 class CopyOutputResult; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 void RunPixelTestWithReadbackTarget(PixelTestType type, | 70 void RunPixelTestWithReadbackTarget(PixelTestType type, |
70 scoped_refptr<Layer> content_root, | 71 scoped_refptr<Layer> content_root, |
71 Layer* target, | 72 Layer* target, |
72 base::FilePath file_name); | 73 base::FilePath file_name); |
73 | 74 |
74 scoped_ptr<SkBitmap> CopyTextureMailboxToBitmap( | 75 scoped_ptr<SkBitmap> CopyTextureMailboxToBitmap( |
75 gfx::Size size, | 76 gfx::Size size, |
76 const TextureMailbox& texture_mailbox); | 77 const TextureMailbox& texture_mailbox); |
77 | 78 |
78 TextureMailbox CopyBitmapToTextureMailboxAsTexture(const SkBitmap& bitmap); | 79 void CopyBitmapToTextureMailboxAsTexture( |
| 80 const SkBitmap& bitmap, |
| 81 TextureMailbox* texture_mailbox, |
| 82 scoped_ptr<ScopedReleaseCallback>* release_callback); |
79 | 83 |
80 void ReleaseTextureMailbox( | 84 void ReleaseTextureMailbox( |
81 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, | 85 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
82 uint32 texture, | 86 uint32 texture, |
83 uint32 sync_point, | 87 uint32 sync_point, |
84 bool lost_resource); | 88 bool lost_resource); |
85 | 89 |
86 // Common CSS colors defined for tests to use. | 90 // Common CSS colors defined for tests to use. |
87 enum Colors { | 91 enum Colors { |
88 kCSSOrange = 0xffffa500, | 92 kCSSOrange = 0xffffa500, |
89 kCSSBrown = 0xffa52a2a, | 93 kCSSBrown = 0xffa52a2a, |
90 kCSSGreen = 0xff008000, | 94 kCSSGreen = 0xff008000, |
91 }; | 95 }; |
92 | 96 |
93 scoped_ptr<PixelComparator> pixel_comparator_; | 97 scoped_ptr<PixelComparator> pixel_comparator_; |
94 PixelTestType test_type_; | 98 PixelTestType test_type_; |
95 scoped_refptr<Layer> content_root_; | 99 scoped_refptr<Layer> content_root_; |
96 Layer* readback_target_; | 100 Layer* readback_target_; |
97 base::FilePath ref_file_; | 101 base::FilePath ref_file_; |
98 scoped_ptr<SkBitmap> result_bitmap_; | 102 scoped_ptr<SkBitmap> result_bitmap_; |
99 std::vector<scoped_refptr<TextureLayer> > texture_layers_; | 103 std::vector<scoped_refptr<TextureLayer> > texture_layers_; |
100 int pending_texture_mailbox_callbacks_; | 104 int pending_texture_mailbox_callbacks_; |
101 }; | 105 }; |
102 | 106 |
103 } // namespace cc | 107 } // namespace cc |
104 | 108 |
105 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ | 109 #endif // CC_TEST_LAYER_TREE_PIXEL_TEST_H_ |
OLD | NEW |