Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Side by Side Diff: tests/GrSurfaceTest.cpp

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/GrPorterDuffTest.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « tests/GrPorterDuffTest.cpp ('k') | tests/ResourceCacheTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698