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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 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
« no previous file with comments | « tests/PremulAlphaRoundTripTest.cpp ('k') | tests/ResourceCacheTest.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 2012 Google Inc. 2 * Copyright 2012 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 // This test is specific to the GPU backend. 8 // This test is specific to the GPU backend.
9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) 9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID)
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 for (int x = 0; x < X_SIZE; ++x) { 74 for (int x = 0; x < X_SIZE; ++x) {
75 if (textureData[x][y] != readback[x][y]) { 75 if (textureData[x][y] != readback[x][y]) {
76 match = false; 76 match = false;
77 } 77 }
78 } 78 }
79 } 79 }
80 80
81 REPORTER_ASSERT(reporter, match); 81 REPORTER_ASSERT(reporter, match);
82 82
83 // Now try writing on the single channel texture 83 // Now try writing on the single channel texture
84 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(texture->asRenderT arget())); 84 SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(texture->asRenderT arget(),
85 SkSurfaceProps(SkSurfaceProps::kLegacyFont Host_InitType)));
85 SkCanvas canvas(device); 86 SkCanvas canvas(device);
86 87
87 SkPaint paint; 88 SkPaint paint;
88 89
89 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ; 90 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ;
90 91
91 paint.setColor(SK_ColorWHITE); 92 paint.setColor(SK_ColorWHITE);
92 93
93 canvas.drawRect(rect, paint); 94 canvas.drawRect(rect, paint);
94 95
95 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, 96 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
96 readback, 0); 97 readback, 0);
97 98
98 match = true; 99 match = true;
99 100
100 for (int y = 0; y < Y_SIZE; ++y) { 101 for (int y = 0; y < Y_SIZE; ++y) {
101 for (int x = 0; x < X_SIZE; ++x) { 102 for (int x = 0; x < X_SIZE; ++x) {
102 if (0xFF != readback[x][y]) { 103 if (0xFF != readback[x][y]) {
103 match = false; 104 match = false;
104 } 105 }
105 } 106 }
106 } 107 }
107 108
108 REPORTER_ASSERT(reporter, match); 109 REPORTER_ASSERT(reporter, match);
109 } 110 }
110 } 111 }
111 112
112 #endif 113 #endif
OLDNEW
« no previous file with comments | « tests/PremulAlphaRoundTripTest.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698