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

Unified Diff: cc/test/pixel_test.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/test/pixel_test_output_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/pixel_test.cc
diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc
index 1565b8ac4fdcdbe5df3885e3637f52a3a16dd9af..3a9b45b50304854ebb156f5bff276fa0c6bfbc0b 100644
--- a/cc/test/pixel_test.cc
+++ b/cc/test/pixel_test.cc
@@ -55,12 +55,26 @@ bool PixelTest::RunPixelTestWithReadbackTarget(
RenderPass* target,
const base::FilePath& ref_file,
const PixelComparator& comparator) {
+ return RunPixelTestWithReadbackTargetAndArea(
+ pass_list, target, ref_file, comparator, nullptr);
+}
+
+bool PixelTest::RunPixelTestWithReadbackTargetAndArea(
+ RenderPassList* pass_list,
+ RenderPass* target,
+ const base::FilePath& ref_file,
+ const PixelComparator& comparator,
+ const gfx::Rect* copy_rect) {
base::RunLoop run_loop;
- target->copy_requests.push_back(CopyOutputRequest::CreateBitmapRequest(
- base::Bind(&PixelTest::ReadbackResult,
- base::Unretained(this),
- run_loop.QuitClosure())));
+ scoped_ptr<CopyOutputRequest> request =
+ CopyOutputRequest::CreateBitmapRequest(
+ base::Bind(&PixelTest::ReadbackResult,
+ base::Unretained(this),
+ run_loop.QuitClosure()));
+ if (copy_rect)
+ request->set_area(*copy_rect);
+ target->copy_requests.push_back(request.Pass());
float device_scale_factor = 1.f;
gfx::Rect device_viewport_rect =
@@ -108,11 +122,12 @@ bool PixelTest::PixelsMatchReference(const base::FilePath& ref_file,
*result_bitmap_, test_data_dir.Append(ref_file), comparator);
}
-void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend) {
+void PixelTest::SetUpGLRenderer(bool use_skia_gpu_backend,
+ bool flipped_output_surface) {
enable_pixel_output_.reset(new gfx::DisableNullDrawGLBindings);
- output_surface_.reset(
- new PixelTestOutputSurface(new TestInProcessContextProvider));
+ output_surface_.reset(new PixelTestOutputSurface(
+ new TestInProcessContextProvider, flipped_output_surface));
output_surface_->BindToClient(output_surface_client_.get());
shared_bitmap_manager_.reset(new TestSharedBitmapManager);
« no previous file with comments | « cc/test/pixel_test.h ('k') | cc/test/pixel_test_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698