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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 SkPaint()); | 107 SkPaint()); |
108 pic.reset(recorder.endRecording()); | 108 pic.reset(recorder.endRecording()); |
109 } | 109 } |
110 | 110 |
111 unsigned key[1] = { 0 }; | 111 unsigned key[1] = { 0 }; |
112 | 112 |
113 SkPaint paint; | 113 SkPaint paint; |
114 GrLayerCache* layerCache = context->getLayerCache(); | 114 GrLayerCache* layerCache = context->getLayerCache(); |
115 GrCachedLayer* layer = layerCache->findLayerOrCreate(pic->uniqueID(), 0, 2, | 115 GrCachedLayer* layer = layerCache->findLayerOrCreate(pic->uniqueID(), 0, 2, |
116 SkIRect::MakeWH(kWidth,
kHeight), | 116 SkIRect::MakeWH(kWidth,
kHeight), |
117 SkIRect::MakeWH(kWidth,
kHeight), | |
118 SkMatrix::I(), key, 1,
&paint); | 117 SkMatrix::I(), key, 1,
&paint); |
119 | 118 |
120 GrSurfaceDesc desc; | 119 GrSurfaceDesc desc; |
121 desc.fConfig = kSkia8888_GrPixelConfig; | 120 desc.fConfig = kSkia8888_GrPixelConfig; |
122 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 121 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
123 desc.fWidth = kWidth; | 122 desc.fWidth = kWidth; |
124 desc.fHeight = kHeight; | 123 desc.fHeight = kHeight; |
125 desc.fSampleCnt = 0; | 124 desc.fSampleCnt = 0; |
126 | 125 |
127 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0
)); | 126 SkAutoTUnref<GrTexture> texture(context->createUncachedTexture(desc, NULL, 0
)); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (NULL == context) { | 160 if (NULL == context) { |
162 continue; | 161 continue; |
163 } | 162 } |
164 | 163 |
165 test_replacements(r, context, true); | 164 test_replacements(r, context, true); |
166 test_replacements(r, context, false); | 165 test_replacements(r, context, false); |
167 } | 166 } |
168 } | 167 } |
169 | 168 |
170 #endif | 169 #endif |
OLD | NEW |