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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "cc/output/gl_renderer.h" | 6 #include "cc/output/gl_renderer.h" |
7 #include "cc/output/software_renderer.h" | 7 #include "cc/output/software_renderer.h" |
8 #include "cc/quads/render_pass.h" | 8 #include "cc/quads/render_pass.h" |
9 #include "cc/test/pixel_comparator.h" | 9 #include "cc/test/pixel_comparator.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 #include "ui/gl/gl_implementation.h" | 12 #include "ui/gl/gl_implementation.h" |
13 | 13 |
14 #ifndef CC_TEST_PIXEL_TEST_H_ | 14 #ifndef CC_TEST_PIXEL_TEST_H_ |
15 #define CC_TEST_PIXEL_TEST_H_ | 15 #define CC_TEST_PIXEL_TEST_H_ |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 class CopyOutputResult; | 18 class CopyOutputResult; |
19 class DirectRenderer; | 19 class DirectRenderer; |
20 class FakeOutputSurfaceClient; | 20 class FakeOutputSurfaceClient; |
21 class OutputSurface; | 21 class OutputSurface; |
22 class ResourceProvider; | 22 class ResourceProvider; |
23 class SoftwareRenderer; | 23 class SoftwareRenderer; |
| 24 class SharedBitmapManager; |
24 | 25 |
25 class PixelTest : public testing::Test, RendererClient { | 26 class PixelTest : public testing::Test, RendererClient { |
26 protected: | 27 protected: |
27 PixelTest(); | 28 PixelTest(); |
28 virtual ~PixelTest(); | 29 virtual ~PixelTest(); |
29 | 30 |
30 enum OffscreenContextOption { | 31 enum OffscreenContextOption { |
31 NoOffscreenContext, | 32 NoOffscreenContext, |
32 WithOffscreenContext | 33 WithOffscreenContext |
33 }; | 34 }; |
34 | 35 |
35 bool RunPixelTest(RenderPassList* pass_list, | 36 bool RunPixelTest(RenderPassList* pass_list, |
36 OffscreenContextOption provide_offscreen_context, | 37 OffscreenContextOption provide_offscreen_context, |
37 const base::FilePath& ref_file, | 38 const base::FilePath& ref_file, |
38 const PixelComparator& comparator); | 39 const PixelComparator& comparator); |
39 | 40 |
40 bool RunPixelTestWithReadbackTarget( | 41 bool RunPixelTestWithReadbackTarget( |
41 RenderPassList* pass_list, | 42 RenderPassList* pass_list, |
42 RenderPass* target, | 43 RenderPass* target, |
43 OffscreenContextOption provide_offscreen_context, | 44 OffscreenContextOption provide_offscreen_context, |
44 const base::FilePath& ref_file, | 45 const base::FilePath& ref_file, |
45 const PixelComparator& comparator); | 46 const PixelComparator& comparator); |
46 | 47 |
47 LayerTreeSettings settings_; | 48 LayerTreeSettings settings_; |
48 gfx::Size device_viewport_size_; | 49 gfx::Size device_viewport_size_; |
49 bool disable_picture_quad_image_filtering_; | 50 bool disable_picture_quad_image_filtering_; |
50 class PixelTestRendererClient; | 51 class PixelTestRendererClient; |
51 scoped_ptr<FakeOutputSurfaceClient> output_surface_client_; | 52 scoped_ptr<FakeOutputSurfaceClient> output_surface_client_; |
52 scoped_ptr<OutputSurface> output_surface_; | 53 scoped_ptr<OutputSurface> output_surface_; |
| 54 scoped_ptr<SharedBitmapManager> shared_bitmap_manager_; |
53 scoped_ptr<ResourceProvider> resource_provider_; | 55 scoped_ptr<ResourceProvider> resource_provider_; |
54 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; | 56 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; |
55 scoped_ptr<DirectRenderer> renderer_; | 57 scoped_ptr<DirectRenderer> renderer_; |
56 scoped_ptr<SkBitmap> result_bitmap_; | 58 scoped_ptr<SkBitmap> result_bitmap_; |
57 gfx::Vector2d external_device_viewport_offset_; | 59 gfx::Vector2d external_device_viewport_offset_; |
58 gfx::Rect external_device_clip_rect_; | 60 gfx::Rect external_device_clip_rect_; |
59 | 61 |
60 void SetUpGLRenderer(bool use_skia_gpu_backend); | 62 void SetUpGLRenderer(bool use_skia_gpu_backend); |
61 void SetUpSoftwareRenderer(); | 63 void SetUpSoftwareRenderer(); |
62 | 64 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 SoftwareRendererWithExpandedViewport>::ExpandedViewport() const { | 188 SoftwareRendererWithExpandedViewport>::ExpandedViewport() const { |
187 return true; | 189 return true; |
188 } | 190 } |
189 | 191 |
190 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest; | 192 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest; |
191 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest; | 193 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest; |
192 | 194 |
193 } // namespace cc | 195 } // namespace cc |
194 | 196 |
195 #endif // CC_TEST_PIXEL_TEST_H_ | 197 #endif // CC_TEST_PIXEL_TEST_H_ |
OLD | NEW |