| 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 #include "Test.h" |
| 9 |
| 8 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 9 | 11 |
| 10 #include "Test.h" | |
| 11 | |
| 12 #include "GrContextFactory.h" | 12 #include "GrContextFactory.h" |
| 13 #include "GrLayerCache.h" | 13 #include "GrLayerCache.h" |
| 14 #include "GrRecordReplaceDraw.h" | 14 #include "GrRecordReplaceDraw.h" |
| 15 #include "RecordTestUtils.h" | 15 #include "RecordTestUtils.h" |
| 16 #include "SkBBHFactory.h" | 16 #include "SkBBHFactory.h" |
| 17 #include "SkPictureRecorder.h" | 17 #include "SkPictureRecorder.h" |
| 18 #include "SkRecordDraw.h" | 18 #include "SkRecordDraw.h" |
| 19 #include "SkRecorder.h" | 19 #include "SkRecorder.h" |
| 20 #include "SkUtils.h" | 20 #include "SkUtils.h" |
| 21 | 21 |
| (...skipping 95 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->createTexture(desc, false, NULL, 0)
); | 127 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de
sc, |
| 128 false, NULL, 0)); |
| 128 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); | 129 layer->setTexture(texture, SkIRect::MakeWH(kWidth, kHeight)); |
| 129 | 130 |
| 130 SkAutoTUnref<SkBBoxHierarchy> bbh; | 131 SkAutoTUnref<SkBBoxHierarchy> bbh; |
| 131 | 132 |
| 132 SkRecord rerecord; | 133 SkRecord rerecord; |
| 133 SkRecorder canvas(&rerecord, kWidth, kHeight); | 134 SkRecorder canvas(&rerecord, kWidth, kHeight); |
| 134 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback*
/); | 135 GrRecordReplaceDraw(pic, &canvas, layerCache, SkMatrix::I(), NULL/*callback*
/); |
| 135 | 136 |
| 136 int recount = rerecord.count(); | 137 int recount = rerecord.count(); |
| 137 REPORTER_ASSERT(r, 2 == recount || 4 == recount); | 138 REPORTER_ASSERT(r, 2 == recount || 4 == recount); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 158 if (NULL == context) { | 159 if (NULL == context) { |
| 159 continue; | 160 continue; |
| 160 } | 161 } |
| 161 | 162 |
| 162 test_replacements(r, context, true); | 163 test_replacements(r, context, true); |
| 163 test_replacements(r, context, false); | 164 test_replacements(r, context, false); |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 | 167 |
| 167 #endif | 168 #endif |
| OLD | NEW |