| 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 #include "SkTypes.h" | 8 #include "SkTypes.h" |
| 9 | 9 |
| 10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 REPORTER_ASSERT(reporter, tex1 == tex1->asTexture()); | 44 REPORTER_ASSERT(reporter, tex1 == tex1->asTexture()); |
| 45 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(tex1) == tex1->asTextu
re()); | 45 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(tex1) == tex1->asTextu
re()); |
| 46 | 46 |
| 47 GrBackendTextureDesc backendDesc; | 47 GrBackendTextureDesc backendDesc; |
| 48 backendDesc.fConfig = kSkia8888_GrPixelConfig; | 48 backendDesc.fConfig = kSkia8888_GrPixelConfig; |
| 49 backendDesc.fFlags = kRenderTarget_GrBackendTextureFlag; | 49 backendDesc.fFlags = kRenderTarget_GrBackendTextureFlag; |
| 50 backendDesc.fWidth = 256; | 50 backendDesc.fWidth = 256; |
| 51 backendDesc.fHeight = 256; | 51 backendDesc.fHeight = 256; |
| 52 backendDesc.fSampleCnt = 0; | 52 backendDesc.fSampleCnt = 0; |
| 53 backendDesc.fTextureHandle = 5; | 53 backendDesc.fTextureHandle = 5; |
| 54 GrSurface* texRT2 = context->textureProvider()->wrapBackendTexture(backe
ndDesc); | 54 GrSurface* texRT2 = context->textureProvider()->wrapBackendTexture( |
| 55 backendDesc, kBorrow_GrWrapOwnership); |
| 55 REPORTER_ASSERT(reporter, texRT2 == texRT2->asRenderTarget()); | 56 REPORTER_ASSERT(reporter, texRT2 == texRT2->asRenderTarget()); |
| 56 REPORTER_ASSERT(reporter, texRT2 == texRT2->asTexture()); | 57 REPORTER_ASSERT(reporter, texRT2 == texRT2->asTexture()); |
| 57 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget
()) == | 58 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget
()) == |
| 58 texRT2->asTexture()); | 59 texRT2->asTexture()); |
| 59 REPORTER_ASSERT(reporter, texRT2->asRenderTarget() == | 60 REPORTER_ASSERT(reporter, texRT2->asRenderTarget() == |
| 60 static_cast<GrSurface*>(texRT2->asTexture())); | 61 static_cast<GrSurface*>(texRT2->asTexture())); |
| 61 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget
()) == | 62 REPORTER_ASSERT(reporter, static_cast<GrSurface*>(texRT2->asRenderTarget
()) == |
| 62 static_cast<GrSurface*>(texRT2->asTexture()))
; | 63 static_cast<GrSurface*>(texRT2->asTexture()))
; |
| 63 | 64 |
| 64 texRT1->unref(); | 65 texRT1->unref(); |
| 65 texRT2->unref(); | 66 texRT2->unref(); |
| 66 tex1->unref(); | 67 tex1->unref(); |
| 67 } | 68 } |
| 68 } | 69 } |
| 69 | 70 |
| 70 #endif | 71 #endif |
| OLD | NEW |