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

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

Issue 2128113002: Use a cc::Display for WebView resourceless software draws. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: displaywebview: mojom Created 4 years, 5 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
« no previous file with comments | « cc/test/fake_output_surface.h ('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/files/file_util.h" 5 #include "base/files/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 "cc/trees/layer_tree_settings.h" 10 #include "cc/trees/layer_tree_settings.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool disable_picture_quad_image_filtering_; 51 bool disable_picture_quad_image_filtering_;
52 class PixelTestRendererClient; 52 class PixelTestRendererClient;
53 std::unique_ptr<FakeOutputSurfaceClient> output_surface_client_; 53 std::unique_ptr<FakeOutputSurfaceClient> output_surface_client_;
54 std::unique_ptr<OutputSurface> output_surface_; 54 std::unique_ptr<OutputSurface> output_surface_;
55 std::unique_ptr<TestSharedBitmapManager> shared_bitmap_manager_; 55 std::unique_ptr<TestSharedBitmapManager> shared_bitmap_manager_;
56 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_; 56 std::unique_ptr<TestGpuMemoryBufferManager> gpu_memory_buffer_manager_;
57 std::unique_ptr<BlockingTaskRunner> main_thread_task_runner_; 57 std::unique_ptr<BlockingTaskRunner> main_thread_task_runner_;
58 std::unique_ptr<ResourceProvider> resource_provider_; 58 std::unique_ptr<ResourceProvider> resource_provider_;
59 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; 59 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
60 std::unique_ptr<DirectRenderer> renderer_; 60 std::unique_ptr<DirectRenderer> renderer_;
61 SoftwareRenderer* software_renderer_ = nullptr;
61 std::unique_ptr<SkBitmap> result_bitmap_; 62 std::unique_ptr<SkBitmap> result_bitmap_;
62 gfx::Vector2d external_device_viewport_offset_; 63 gfx::Vector2d external_device_viewport_offset_;
63 gfx::Rect external_device_clip_rect_; 64 gfx::Rect external_device_clip_rect_;
64 65
65 void SetUpGLRenderer(bool use_skia_gpu_backend, bool flipped_output_surface); 66 void SetUpGLRenderer(bool use_skia_gpu_backend, bool flipped_output_surface);
66 void SetUpSoftwareRenderer(); 67 void SetUpSoftwareRenderer();
67 68
68 void ForceExpandedViewport(const gfx::Size& surface_expansion); 69 void ForceExpandedViewport(const gfx::Size& surface_expansion);
69 void ForceViewportOffset(const gfx::Vector2d& viewport_offset); 70 void ForceViewportOffset(const gfx::Vector2d& viewport_offset);
70 void ForceDeviceClip(const gfx::Rect& clip); 71 void ForceDeviceClip(const gfx::Rect& clip);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 texture_mailbox_deleter, 112 texture_mailbox_deleter,
112 highp_threshold_min) {} 113 highp_threshold_min) {}
113 }; 114 };
114 115
115 class SoftwareRendererWithExpandedViewport : public SoftwareRenderer { 116 class SoftwareRendererWithExpandedViewport : public SoftwareRenderer {
116 public: 117 public:
117 SoftwareRendererWithExpandedViewport(RendererClient* client, 118 SoftwareRendererWithExpandedViewport(RendererClient* client,
118 const RendererSettings* settings, 119 const RendererSettings* settings,
119 OutputSurface* output_surface, 120 OutputSurface* output_surface,
120 ResourceProvider* resource_provider) 121 ResourceProvider* resource_provider)
121 : SoftwareRenderer(client, 122 : SoftwareRenderer(client, settings, output_surface, resource_provider) {}
122 settings,
123 output_surface,
124 resource_provider,
125 true /* use_image_hijack_canvas */) {}
126 }; 123 };
127 124
128 class GLRendererWithFlippedSurface : public GLRenderer { 125 class GLRendererWithFlippedSurface : public GLRenderer {
129 public: 126 public:
130 GLRendererWithFlippedSurface(RendererClient* client, 127 GLRendererWithFlippedSurface(RendererClient* client,
131 const RendererSettings* settings, 128 const RendererSettings* settings,
132 OutputSurface* output_surface, 129 OutputSurface* output_surface,
133 ResourceProvider* resource_provider, 130 ResourceProvider* resource_provider,
134 TextureMailboxDeleter* texture_mailbox_deleter, 131 TextureMailboxDeleter* texture_mailbox_deleter,
135 int highp_threshold_min) 132 int highp_threshold_min)
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 ForceExpandedViewport(gfx::Size(50, 50)); 166 ForceExpandedViewport(gfx::Size(50, 50));
170 ForceViewportOffset(gfx::Vector2d(10, 20)); 167 ForceViewportOffset(gfx::Vector2d(10, 20));
171 } 168 }
172 169
173 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest; 170 typedef RendererPixelTest<GLRenderer> GLRendererPixelTest;
174 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest; 171 typedef RendererPixelTest<SoftwareRenderer> SoftwareRendererPixelTest;
175 172
176 } // namespace cc 173 } // namespace cc
177 174
178 #endif // CC_TEST_PIXEL_TEST_H_ 175 #endif // CC_TEST_PIXEL_TEST_H_
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/test/pixel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698