OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 SkIRect::MakeWH(kWidth,
kHeight), | 117 SkIRect::MakeWH(kWidth,
kHeight), |
118 SkMatrix::I(), key, 1,
&paint); | 118 SkMatrix::I(), key, 1,
&paint); |
119 | 119 |
120 GrSurfaceDesc desc; | 120 GrSurfaceDesc desc; |
121 desc.fConfig = kSkia8888_GrPixelConfig; | 121 desc.fConfig = kSkia8888_GrPixelConfig; |
122 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 122 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
123 desc.fWidth = kWidth; | 123 desc.fWidth = kWidth; |
124 desc.fHeight = kHeight; | 124 desc.fHeight = kHeight; |
125 desc.fSampleCnt = 0; | 125 desc.fSampleCnt = 0; |
126 | 126 |
127 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0
)); | 127 SkAutoTUnref<GrTexture> texture(context->createTexture(desc, false, NULL, 0)
); |
128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); | 128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); |
129 | 129 |
130 SkAutoTUnref<SkBBoxHierarchy> bbh; | 130 SkAutoTUnref<SkBBoxHierarchy> bbh; |
131 | 131 |
132 SkRecord rerecord; | 132 SkRecord rerecord; |
133 SkRecorder canvas(&rerecord, kWidth, kHeight); | 133 SkRecorder canvas(&rerecord, kWidth, kHeight); |
134 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback*
/); | 134 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback*
/); |
135 | 135 |
136 int recount = rerecord.count(); | 136 int recount = rerecord.count(); |
137 REPORTER_ASSERT(r, 2 == recount || 4 == recount); | 137 REPORTER_ASSERT(r, 2 == recount || 4 == recount); |
(...skipping 20 matching lines...) Expand all Loading... |
158 if (NULL == context) { | 158 if (NULL == context) { |
159 continue; | 159 continue; |
160 } | 160 } |
161 | 161 |
162 test_replacements(r, context, true); | 162 test_replacements(r, context, true); |
163 test_replacements(r, context, false); | 163 test_replacements(r, context, false); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 #endif | 167 #endif |
OLD | NEW |