Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: cc/test/pixel_test.h

Issue 23454014: cc: Drop ContextProvider references on the impl thread before quitting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: callbackcontrolcenter: rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/resources/texture_mailbox_deleter_unittest.cc ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 29 matching lines...) Expand all
40 RenderPass* target, 40 RenderPass* target,
41 OffscreenContextOption provide_offscreen_context, 41 OffscreenContextOption provide_offscreen_context,
42 const base::FilePath& ref_file, 42 const base::FilePath& ref_file,
43 const PixelComparator& comparator); 43 const PixelComparator& comparator);
44 44
45 LayerTreeSettings settings_; 45 LayerTreeSettings settings_;
46 gfx::Size device_viewport_size_; 46 gfx::Size device_viewport_size_;
47 class PixelTestRendererClient; 47 class PixelTestRendererClient;
48 scoped_ptr<OutputSurface> output_surface_; 48 scoped_ptr<OutputSurface> output_surface_;
49 scoped_ptr<ResourceProvider> resource_provider_; 49 scoped_ptr<ResourceProvider> resource_provider_;
50 scoped_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
50 scoped_ptr<PixelTestRendererClient> fake_client_; 51 scoped_ptr<PixelTestRendererClient> fake_client_;
51 scoped_ptr<DirectRenderer> renderer_; 52 scoped_ptr<DirectRenderer> renderer_;
52 scoped_ptr<SkBitmap> result_bitmap_; 53 scoped_ptr<SkBitmap> result_bitmap_;
53 54
54 void SetUpGLRenderer(bool use_skia_gpu_backend); 55 void SetUpGLRenderer(bool use_skia_gpu_backend);
55 void SetUpSoftwareRenderer(); 56 void SetUpSoftwareRenderer();
56 57
57 void ForceExpandedViewport(gfx::Size surface_expansion, 58 void ForceExpandedViewport(gfx::Size surface_expansion,
58 gfx::Vector2d viewport_offset); 59 gfx::Vector2d viewport_offset);
59 void ForceDeviceClip(gfx::Rect clip); 60 void ForceDeviceClip(gfx::Rect clip);
(...skipping 22 matching lines...) Expand all
82 }; 83 };
83 84
84 // A simple wrapper to differentiate a renderer that should use ganesh 85 // A simple wrapper to differentiate a renderer that should use ganesh
85 // and one that shouldn't in templates. 86 // and one that shouldn't in templates.
86 class GLRendererWithSkiaGPUBackend : public GLRenderer { 87 class GLRendererWithSkiaGPUBackend : public GLRenderer {
87 public: 88 public:
88 GLRendererWithSkiaGPUBackend(RendererClient* client, 89 GLRendererWithSkiaGPUBackend(RendererClient* client,
89 const LayerTreeSettings* settings, 90 const LayerTreeSettings* settings,
90 OutputSurface* output_surface, 91 OutputSurface* output_surface,
91 ResourceProvider* resource_provider, 92 ResourceProvider* resource_provider,
93 TextureMailboxDeleter* texture_mailbox_deleter,
92 int highp_threshold_min) 94 int highp_threshold_min)
93 : GLRenderer(client, 95 : GLRenderer(client,
94 settings, 96 settings,
95 output_surface, 97 output_surface,
96 resource_provider, 98 resource_provider,
99 texture_mailbox_deleter,
97 highp_threshold_min) {} 100 highp_threshold_min) {}
98 }; 101 };
99 102
100 // Wrappers to differentiate renderers where the the output surface and viewport 103 // Wrappers to differentiate renderers where the the output surface and viewport
101 // have an externally determined size and offset. 104 // have an externally determined size and offset.
102 class GLRendererWithExpandedViewport : public GLRenderer { 105 class GLRendererWithExpandedViewport : public GLRenderer {
103 public: 106 public:
104 GLRendererWithExpandedViewport(RendererClient* client, 107 GLRendererWithExpandedViewport(RendererClient* client,
105 const LayerTreeSettings* settings, 108 const LayerTreeSettings* settings,
106 OutputSurface* output_surface, 109 OutputSurface* output_surface,
107 ResourceProvider* resource_provider, 110 ResourceProvider* resource_provider,
111 TextureMailboxDeleter* texture_mailbox_deleter,
108 int highp_threshold_min) 112 int highp_threshold_min)
109 : GLRenderer(client, 113 : GLRenderer(client,
110 settings, 114 settings,
111 output_surface, 115 output_surface,
112 resource_provider, 116 resource_provider,
117 texture_mailbox_deleter,
113 highp_threshold_min) {} 118 highp_threshold_min) {}
114 }; 119 };
115 120
116 class SoftwareRendererWithExpandedViewport : public SoftwareRenderer { 121 class SoftwareRendererWithExpandedViewport : public SoftwareRenderer {
117 public: 122 public:
118 SoftwareRendererWithExpandedViewport(RendererClient* client, 123 SoftwareRendererWithExpandedViewport(RendererClient* client,
119 const LayerTreeSettings* settings, 124 const LayerTreeSettings* settings,
120 OutputSurface* output_surface, 125 OutputSurface* output_surface,
121 ResourceProvider* resource_provider) 126 ResourceProvider* resource_provider)
122 : SoftwareRenderer(client, settings, output_surface, resource_provider) {} 127 : SoftwareRenderer(client, settings, output_surface, resource_provider) {}
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 213 }
209 214
210 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest; 215 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest;
211 typedef RendererPixelTest<GLRendererWithSkiaGPUBackend> 216 typedef RendererPixelTest<GLRendererWithSkiaGPUBackend>
212 GLRendererSkiaGPUBackendPixelTest; 217 GLRendererSkiaGPUBackendPixelTest;
213 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest; 218 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest;
214 219
215 } // namespace cc 220 } // namespace cc
216 221
217 #endif // CC_TEST_PIXEL_TEST_H_ 222 #endif // CC_TEST_PIXEL_TEST_H_
OLDNEW
« no previous file with comments | « cc/resources/texture_mailbox_deleter_unittest.cc ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698