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

Side by Side Diff: tests/ReadPixelsTest.cpp

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment 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 | « tests/PrimitiveProcessorTest.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkMathPriv.h" 10 #include "SkMathPriv.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) { 390 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) {
391 for (auto& origin : {kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin}) { 391 for (auto& origin : {kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin}) {
392 GrSurfaceDesc desc; 392 GrSurfaceDesc desc;
393 desc.fFlags = kRenderTarget_GrSurfaceFlag; 393 desc.fFlags = kRenderTarget_GrSurfaceFlag;
394 desc.fWidth = DEV_W; 394 desc.fWidth = DEV_W;
395 desc.fHeight = DEV_H; 395 desc.fHeight = DEV_H;
396 desc.fConfig = kSkia8888_GrPixelConfig; 396 desc.fConfig = kSkia8888_GrPixelConfig;
397 desc.fOrigin = origin; 397 desc.fOrigin = origin;
398 SkAutoTUnref<GrTexture> surfaceTexture( 398 SkAutoTUnref<GrTexture> surfaceTexture(
399 ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudget ed::kNo)); 399 ctxInfo.grContext()->textureProvider()->createTexture(desc, SkBudget ed::kNo));
400 auto surface(SkSurface::MakeRenderTargetDirect(surfaceTexture->asRenderT arget())); 400 auto surface(SkSurface::MakeRenderTargetDirect(surfaceTexture->asRenderT arget(), nullptr));
401 desc.fFlags = kNone_GrSurfaceFlags; 401 desc.fFlags = kNone_GrSurfaceFlags;
402 test_readpixels(reporter, surface, kLast_BitmapInit); 402 test_readpixels(reporter, surface, kLast_BitmapInit);
403 } 403 }
404 } 404 }
405 #endif 405 #endif
406 406
407 #if SK_SUPPORT_GPU 407 #if SK_SUPPORT_GPU
408 static void test_readpixels_texture(skiatest::Reporter* reporter, GrTexture* tex ture) { 408 static void test_readpixels_texture(skiatest::Reporter* reporter, GrTexture* tex ture) {
409 fill_src_texture(texture); 409 fill_src_texture(texture);
410 for (size_t rect = 0; rect < SK_ARRAY_COUNT(gReadPixelsTestRects); ++rect) { 410 for (size_t rect = 0; rect < SK_ARRAY_COUNT(gReadPixelsTestRects); ++rect) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 desc.fHeight = DEV_H; 452 desc.fHeight = DEV_H;
453 desc.fConfig = kSkia8888_GrPixelConfig; 453 desc.fConfig = kSkia8888_GrPixelConfig;
454 desc.fOrigin = origin; 454 desc.fOrigin = origin;
455 desc.fFlags = kNone_GrSurfaceFlags; 455 desc.fFlags = kNone_GrSurfaceFlags;
456 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc , 456 texture.reset(ctxInfo.grContext()->textureProvider()->createTexture(desc ,
457 SkBu dgeted::kNo)); 457 SkBu dgeted::kNo));
458 test_readpixels_texture(reporter, texture); 458 test_readpixels_texture(reporter, texture);
459 } 459 }
460 } 460 }
461 #endif 461 #endif
OLDNEW
« no previous file with comments | « tests/PrimitiveProcessorTest.cpp ('k') | tests/ReadWriteAlphaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698