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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 392333008: Make GrCacheable implement its own ref counting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove extra blank line Created 6 years, 5 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/ClipCacheTest.cpp ('k') | no next file » | 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 2012 Google Inc. 2 * Copyright 2012 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 // This test is specific to the GPU backend. 8 // This test is specific to the GPU backend.
9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID) 9 #if SK_SUPPORT_GPU && !defined(SK_BUILD_FOR_ANDROID)
10 10
(...skipping 27 matching lines...) Expand all
38 desc.fConfig = kAlpha_8_GrPixelConfig; 38 desc.fConfig = kAlpha_8_GrPixelConfig;
39 desc.fWidth = X_SIZE; 39 desc.fWidth = X_SIZE;
40 desc.fHeight = Y_SIZE; 40 desc.fHeight = Y_SIZE;
41 41
42 // We are initializing the texture with zeros here 42 // We are initializing the texture with zeros here
43 GrTexture* texture = context->createUncachedTexture(desc, textureData, 0 ); 43 GrTexture* texture = context->createUncachedTexture(desc, textureData, 0 );
44 if (!texture) { 44 if (!texture) {
45 return; 45 return;
46 } 46 }
47 47
48 SkAutoUnref au(texture); 48 SkAutoTUnref<GrTexture> au(texture);
49 49
50 // create a distinctive texture 50 // create a distinctive texture
51 for (int y = 0; y < Y_SIZE; ++y) { 51 for (int y = 0; y < Y_SIZE; ++y) {
52 for (int x = 0; x < X_SIZE; ++x) { 52 for (int x = 0; x < X_SIZE; ++x) {
53 textureData[x][y] = x*Y_SIZE+y; 53 textureData[x][y] = x*Y_SIZE+y;
54 } 54 }
55 } 55 }
56 56
57 // upload the texture 57 // upload the texture
58 texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig, 58 texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 match = false; 103 match = false;
104 } 104 }
105 } 105 }
106 } 106 }
107 107
108 REPORTER_ASSERT(reporter, match); 108 REPORTER_ASSERT(reporter, match);
109 } 109 }
110 } 110 }
111 111
112 #endif 112 #endif
OLDNEW
« no previous file with comments | « tests/ClipCacheTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698