| OLD | NEW | 
|---|
|  | (Empty) | 
| 1 /* |  | 
| 2  * Copyright 2011 Google Inc. |  | 
| 3  * |  | 
| 4  * Use of this source code is governed by a BSD-style license that can be |  | 
| 5  * found in the LICENSE file. |  | 
| 6  */ |  | 
| 7 |  | 
| 8 #include "Test.h" |  | 
| 9 |  | 
| 10 // This is a GPU-backend specific test |  | 
| 11 #if SK_SUPPORT_GPU |  | 
| 12 |  | 
| 13 #include "GrContextFactory.h" |  | 
| 14 |  | 
| 15 DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { |  | 
| 16     for (int i = 0; i <= GrContextFactory::kLastGLContextType; ++i) { |  | 
| 17         GrContextFactory::GLContextType glCtxType = (GrContextFactory::GLContext
    Type)i; |  | 
| 18         // this forces the factory to make the context if it hasn't yet |  | 
| 19         factory->get(glCtxType); |  | 
| 20         SkGLContextHelper* glCtxHelper = factory->getGLContext(glCtxType); |  | 
| 21 |  | 
| 22         // We're supposed to fail the NVPR context type when we the native conte
    xt that does not |  | 
| 23         // support the NVPR extension. |  | 
| 24         if (GrContextFactory::kNVPR_GLContextType == glCtxType && |  | 
| 25             NULL != factory->getGLContext(GrContextFactory::kNative_GLContextTyp
    e) && |  | 
| 26             !factory->getGLContext(GrContextFactory::kNative_GLContextType)->has
    Extension("GL_NV_path_rendering")) { |  | 
| 27             REPORTER_ASSERT(reporter, NULL == glCtxHelper); |  | 
| 28             continue; |  | 
| 29         } |  | 
| 30 |  | 
| 31         REPORTER_ASSERT(reporter, NULL != glCtxHelper); |  | 
| 32         if (NULL != glCtxHelper) { |  | 
| 33             const GrGLInterface* interface = glCtxHelper->gl(); |  | 
| 34             REPORTER_ASSERT(reporter, interface->validate()); |  | 
| 35         } |  | 
| 36     } |  | 
| 37 } |  | 
| 38 |  | 
| 39 #endif |  | 
| OLD | NEW | 
|---|