| 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 "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 #include "Test.h" | 9 #include "Test.h" |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 DEF_GPUTEST(ImageIsOpaqueTest_GPU, reporter, factory) { | 68 DEF_GPUTEST(ImageIsOpaqueTest_GPU, reporter, factory) { |
| 69 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { | 69 for (int i = 0; i < GrContextFactory::kGLContextTypeCnt; ++i) { |
| 70 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; | 70 GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
Type) i; |
| 71 | 71 |
| 72 if (!GrContextFactory::IsRenderingGLContext(glCtxType)) { | 72 if (!GrContextFactory::IsRenderingGLContext(glCtxType)) { |
| 73 continue; | 73 continue; |
| 74 } | 74 } |
| 75 | 75 |
| 76 GrContext* context = factory->get(glCtxType); | 76 GrContext* context = factory->get(glCtxType); |
| 77 | 77 |
| 78 if (NULL == context) { | 78 if (nullptr == context) { |
| 79 continue; | 79 continue; |
| 80 } | 80 } |
| 81 | 81 |
| 82 SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5); | 82 SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5); |
| 83 SkAutoTUnref<SkSurface> surfaceTransparent( | 83 SkAutoTUnref<SkSurface> surfaceTransparent( |
| 84 SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoTran
sparent)); | 84 SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoTran
sparent)); |
| 85 check_isopaque(reporter, surfaceTransparent, false); | 85 check_isopaque(reporter, surfaceTransparent, false); |
| 86 | 86 |
| 87 SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType)
; | 87 SkImageInfo infoOpaque = SkImageInfo::MakeN32(5, 5, kOpaque_SkAlphaType)
; |
| 88 SkAutoTUnref<SkSurface> surfaceOpaque( | 88 SkAutoTUnref<SkSurface> surfaceOpaque( |
| 89 SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoOpaq
ue)); | 89 SkSurface::NewRenderTarget(context,SkSurface::kNo_Budgeted, infoOpaq
ue)); |
| 90 #if 0 | 90 #if 0 |
| 91 // this is failing right now : TODO fix me | 91 // this is failing right now : TODO fix me |
| 92 check_isopaque(reporter, surfaceOpaque, true); | 92 check_isopaque(reporter, surfaceOpaque, true); |
| 93 #endif | 93 #endif |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 #endif | 97 #endif |
| OLD | NEW |