OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 // This test is specific to the GPU backend. | 9 // This test is specific to the GPU backend. |
10 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) | 10 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 for (int x = 0; x < X_SIZE; ++x) { | 75 for (int x = 0; x < X_SIZE; ++x) { |
76 if (textureData[x][y] != readback[x][y]) { | 76 if (textureData[x][y] != readback[x][y]) { |
77 match = false; | 77 match = false; |
78 } | 78 } |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 REPORTER_ASSERT(reporter, match); | 82 REPORTER_ASSERT(reporter, match); |
83 | 83 |
84 // Now try writing on the single channel texture | 84 // Now try writing on the single channel texture |
85 SkAutoTUnref<SkDevice> device(new SkGpuDevice(context, texture->asRender
Target())); | 85 SkAutoTUnref<SkBaseDevice> device(new SkGpuDevice(context, texture->asRe
nderTarget())); |
86 SkCanvas canvas(device); | 86 SkCanvas canvas(device); |
87 | 87 |
88 SkPaint paint; | 88 SkPaint paint; |
89 | 89 |
90 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)
; |
91 | 91 |
92 paint.setColor(SK_ColorWHITE); | 92 paint.setColor(SK_ColorWHITE); |
93 | 93 |
94 canvas.drawRect(rect, paint); | 94 canvas.drawRect(rect, paint); |
95 | 95 |
(...skipping 11 matching lines...) Expand all Loading... |
107 } | 107 } |
108 | 108 |
109 REPORTER_ASSERT(reporter, match); | 109 REPORTER_ASSERT(reporter, match); |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 #include "TestClassDef.h" | 113 #include "TestClassDef.h" |
114 DEFINE_GPUTESTCLASS("ReadWriteAlpha", ReadWriteAlphaTestClass, ReadWriteAlphaTes
t) | 114 DEFINE_GPUTESTCLASS("ReadWriteAlpha", ReadWriteAlphaTestClass, ReadWriteAlphaTes
t) |
115 | 115 |
116 #endif | 116 #endif |
OLD | NEW |