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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 583773004: Revert of introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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)));
86 SkCanvas canvas(device); 85 SkCanvas canvas(device);
87 86
88 SkPaint paint; 87 SkPaint paint;
89 88
90 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ; 89 const SkRect rect = SkRect::MakeLTRB(-10, -10, X_SIZE + 10, Y_SIZE + 10) ;
91 90
92 paint.setColor(SK_ColorWHITE); 91 paint.setColor(SK_ColorWHITE);
93 92
94 canvas.drawRect(rect, paint); 93 canvas.drawRect(rect, paint);
95 94
96 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, 95 texture->readPixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
97 readback, 0); 96 readback, 0);
98 97
99 match = true; 98 match = true;
100 99
101 for (int y = 0; y < Y_SIZE; ++y) { 100 for (int y = 0; y < Y_SIZE; ++y) {
102 for (int x = 0; x < X_SIZE; ++x) { 101 for (int x = 0; x < X_SIZE; ++x) {
103 if (0xFF != readback[x][y]) { 102 if (0xFF != readback[x][y]) {
104 match = false; 103 match = false;
105 } 104 }
106 } 105 }
107 } 106 }
108 107
109 REPORTER_ASSERT(reporter, match); 108 REPORTER_ASSERT(reporter, match);
110 } 109 }
111 } 110 }
112 111
113 #endif 112 #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