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

Side by Side Diff: tests/ReadPixelsTest.cpp

Issue 22522002: Fix BGRA readback on Android (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | « tests/PremulAlphaRoundTripTest.cpp ('k') | tests/WritePixelsTest.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "Test.h" 9 #include "Test.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 #else 338 #else
339 continue; 339 continue;
340 #endif 340 #endif
341 } 341 }
342 SkCanvas canvas(device); 342 SkCanvas canvas(device);
343 fillCanvas(&canvas); 343 fillCanvas(&canvas);
344 344
345 static const SkCanvas::Config8888 gReadConfigs[] = { 345 static const SkCanvas::Config8888 gReadConfigs[] = {
346 SkCanvas::kNative_Premul_Config8888, 346 SkCanvas::kNative_Premul_Config8888,
347 SkCanvas::kNative_Unpremul_Config8888, 347 SkCanvas::kNative_Unpremul_Config8888,
348 /** 348
349 * There is a bug in Ganesh (http://code.google.com/p/skia/issues/detail?id=4 38)
350 * that causes the readback of pixels from BGRA canvas to an RGBA bitmap to
351 * fail. This should be removed as soon as the issue above is resolved.
352 */
353 #if !defined(SK_BUILD_FOR_ANDROID)
354 SkCanvas::kBGRA_Premul_Config8888, 349 SkCanvas::kBGRA_Premul_Config8888,
355 SkCanvas::kBGRA_Unpremul_Config8888, 350 SkCanvas::kBGRA_Unpremul_Config8888,
356 #endif 351
357 SkCanvas::kRGBA_Premul_Config8888, 352 SkCanvas::kRGBA_Premul_Config8888,
358 SkCanvas::kRGBA_Unpremul_Config8888, 353 SkCanvas::kRGBA_Unpremul_Config8888,
359 }; 354 };
360 for (size_t rect = 0; rect < SK_ARRAY_COUNT(testRects); ++rect) { 355 for (size_t rect = 0; rect < SK_ARRAY_COUNT(testRects); ++rect) {
361 const SkIRect& srcRect = testRects[rect]; 356 const SkIRect& srcRect = testRects[rect];
362 for (BitmapInit bmi = kFirstBitmapInit; 357 for (BitmapInit bmi = kFirstBitmapInit;
363 bmi < kBitmapInitCnt; 358 bmi < kBitmapInitCnt;
364 bmi = nextBMI(bmi)) { 359 bmi = nextBMI(bmi)) {
365 for (size_t c = 0; c < SK_ARRAY_COUNT(gReadConfigs); ++c) { 360 for (size_t c = 0; c < SK_ARRAY_COUNT(gReadConfigs); ++c) {
366 SkCanvas::Config8888 config8888 = gReadConfigs[c]; 361 SkCanvas::Config8888 config8888 = gReadConfigs[c];
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 406 }
412 } 407 }
413 } 408 }
414 } 409 }
415 } 410 }
416 } 411 }
417 } 412 }
418 413
419 #include "TestClassDef.h" 414 #include "TestClassDef.h"
420 DEFINE_GPUTESTCLASS("ReadPixels", ReadPixelsTestClass, ReadPixelsTest) 415 DEFINE_GPUTESTCLASS("ReadPixels", ReadPixelsTestClass, ReadPixelsTest)
OLDNEW
« no previous file with comments | « tests/PremulAlphaRoundTripTest.cpp ('k') | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698