| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 // This is a GPU-backend specific test. | |
| 10 | |
| 11 #include "SkTypes.h" | |
| 12 | |
| 13 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
| 14 | 9 |
| 15 #include "Test.h" | |
| 16 #include "GrContext.h" | 10 #include "GrContext.h" |
| 17 #include "GrContextFactory.h" | 11 #include "GrContextFactory.h" |
| 18 #include "GrRenderTarget.h" | 12 #include "GrRenderTarget.h" |
| 19 #include "GrTexture.h" | 13 #include "GrTexture.h" |
| 14 #include "SkTypes.h" |
| 15 #include "Test.h" |
| 16 #include "TestClassDef.h" |
| 20 | 17 |
| 21 static void GrSurfaceIsSameTest(skiatest::Reporter* reporter, GrContextFactory*
factory) { | 18 DEF_GPUTEST(GrSurfaceTest, reporter, factory) { |
| 22 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType); | 19 GrContext* context = factory->get(GrContextFactory::kNull_GLContextType); |
| 23 if (NULL != context) { | 20 if (NULL != context) { |
| 24 GrTextureDesc desc; | 21 GrTextureDesc desc; |
| 25 desc.fConfig = kSkia8888_GrPixelConfig; | 22 desc.fConfig = kSkia8888_GrPixelConfig; |
| 26 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 23 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
| 27 desc.fWidth = 256; | 24 desc.fWidth = 256; |
| 28 desc.fHeight = 256; | 25 desc.fHeight = 256; |
| 29 desc.fSampleCnt = 0; | 26 desc.fSampleCnt = 0; |
| 30 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); | 27 GrSurface* texRT1 = context->createUncachedTexture(desc, NULL, 0); |
| 31 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0); | 28 GrSurface* texRT2 = context->createUncachedTexture(desc, NULL, 0); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 REPORTER_ASSERT(reporter, !externalTexRT->isSameAs(texRT1)); | 52 REPORTER_ASSERT(reporter, !externalTexRT->isSameAs(texRT1)); |
| 56 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->isSameAs(tex
RT1)); | 53 REPORTER_ASSERT(reporter, !externalTexRT->asRenderTarget()->isSameAs(tex
RT1)); |
| 57 | 54 |
| 58 texRT1->unref(); | 55 texRT1->unref(); |
| 59 texRT2->unref(); | 56 texRT2->unref(); |
| 60 tex1->unref(); | 57 tex1->unref(); |
| 61 externalTexRT->unref(); | 58 externalTexRT->unref(); |
| 62 } | 59 } |
| 63 } | 60 } |
| 64 | 61 |
| 65 #include "TestClassDef.h" | |
| 66 DEFINE_GPUTESTCLASS("GrSurfaceIsSame", GrSurfaceIsSameTestClass, GrSurfaceIsSame
Test) | |
| 67 | |
| 68 #endif | 62 #endif |
| OLD | NEW |