| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GLBench.h" | 8 #include "GLBench.h" |
| 9 | 9 |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| 11 #include "GrGpu.h" |
| 11 #include "GrTest.h" | 12 #include "GrTest.h" |
| 13 #include "gl/GrGLContext.h" |
| 12 #include <stdio.h> | 14 #include <stdio.h> |
| 13 | 15 |
| 14 const GrGLContext* GLBench::getGLContext(SkCanvas* canvas) { | 16 const GrGLContext* GLBench::getGLContext(SkCanvas* canvas) { |
| 15 // This bench exclusively tests GL calls directly | 17 // This bench exclusively tests GL calls directly |
| 16 if (nullptr == canvas->getGrContext()) { | 18 if (nullptr == canvas->getGrContext()) { |
| 17 return nullptr; | 19 return nullptr; |
| 18 } | 20 } |
| 19 GrContext* context = canvas->getGrContext(); | 21 GrContext* context = canvas->getGrContext(); |
| 20 GrGpu* gpu = context->getGpu(); | 22 GrGpu* gpu = context->getGpu(); |
| 21 if (!gpu) { | 23 if (!gpu) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 bm.setPixels(readback.get()); | 166 bm.setPixels(readback.get()); |
| 165 | 167 |
| 166 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100
)) { | 168 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100
)) { |
| 167 SkDebugf("------ failed to encode %s\n", filename); | 169 SkDebugf("------ failed to encode %s\n", filename); |
| 168 remove(filename); // remove any partial file | 170 remove(filename); // remove any partial file |
| 169 return; | 171 return; |
| 170 } | 172 } |
| 171 } | 173 } |
| 172 | 174 |
| 173 #endif | 175 #endif |
| OLD | NEW |