OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { | 256 for (int type = 0; type < GrContextFactory::kLastGLContextType; ++type) { |
257 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); | 257 GrContextFactory::GLContextType glType = static_cast<GrContextFactory::G
LContextType>(type); |
258 if (!GrContextFactory::IsRenderingGLContext(glType)) { | 258 if (!GrContextFactory::IsRenderingGLContext(glType)) { |
259 continue; | 259 continue; |
260 } | 260 } |
261 GrContext* context = factory->get(glType); | 261 GrContext* context = factory->get(glType); |
262 if (NULL == context) { | 262 if (NULL == context) { |
263 continue; | 263 continue; |
264 } | 264 } |
265 | 265 |
266 GrTextureDesc desc; | 266 GrSurfaceDesc desc; |
267 desc.fConfig = kSkia8888_GrPixelConfig; | 267 desc.fConfig = kSkia8888_GrPixelConfig; |
268 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 268 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
269 desc.fWidth = gWidth; | 269 desc.fWidth = gWidth; |
270 desc.fHeight = gHeight; | 270 desc.fHeight = gHeight; |
271 SkImageInfo info = SkImageInfo::MakeN32Premul(gWidth, gHeight); | 271 SkImageInfo info = SkImageInfo::MakeN32Premul(gWidth, gHeight); |
272 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, info
)); | 272 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(context, info
)); |
273 | 273 |
274 test_cache(reporter, context, surface->getCanvas()); | 274 test_cache(reporter, context, surface->getCanvas()); |
275 test_purge_invalidated(reporter, context); | 275 test_purge_invalidated(reporter, context); |
276 test_cache_delete_on_destruction(reporter, context); | 276 test_cache_delete_on_destruction(reporter, context); |
277 test_resource_size_changed(reporter, context); | 277 test_resource_size_changed(reporter, context); |
278 } | 278 } |
279 } | 279 } |
280 | 280 |
281 #endif | 281 #endif |
OLD | NEW |