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

Side by Side Diff: tests/ReadWriteAlphaTest.cpp

Issue 864383003: Remove createUncachedTexture function, attempt to recycle scratch in createTexture. (Closed) Base URL: https://skia.googlesource.com/skia.git@continue
Patch Set: Comments, fixes Created 5 years, 10 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/ReadPixelsTest.cpp ('k') | tests/RecordReplaceDrawTest.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 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 #include "Test.h" 8 #include "Test.h"
9 9
10 // This test is specific to the GPU backend. 10 // This test is specific to the GPU backend.
(...skipping 23 matching lines...) Expand all
34 GrSurfaceDesc desc; 34 GrSurfaceDesc desc;
35 35
36 // let Skia know we will be using this texture as a render target 36 // let Skia know we will be using this texture as a render target
37 desc.fFlags = kRenderTarget_GrSurfaceFlag; 37 desc.fFlags = kRenderTarget_GrSurfaceFlag;
38 // it is a single channel texture 38 // it is a single channel texture
39 desc.fConfig = kAlpha_8_GrPixelConfig; 39 desc.fConfig = kAlpha_8_GrPixelConfig;
40 desc.fWidth = X_SIZE; 40 desc.fWidth = X_SIZE;
41 desc.fHeight = Y_SIZE; 41 desc.fHeight = Y_SIZE;
42 42
43 // We are initializing the texture with zeros here 43 // We are initializing the texture with zeros here
44 GrTexture* texture = context->createUncachedTexture(desc, textureData, 0 ); 44 GrTexture* texture = context->createTexture(desc, false, textureData, 0) ;
45 if (!texture) { 45 if (!texture) {
46 return; 46 return;
47 } 47 }
48 48
49 SkAutoTUnref<GrTexture> au(texture); 49 SkAutoTUnref<GrTexture> au(texture);
50 50
51 // create a distinctive texture 51 // create a distinctive texture
52 for (int y = 0; y < Y_SIZE; ++y) { 52 for (int y = 0; y < Y_SIZE; ++y) {
53 for (int x = 0; x < X_SIZE; ++x) { 53 for (int x = 0; x < X_SIZE; ++x) {
54 textureData[x][y] = x*Y_SIZE+y; 54 textureData[x][y] = x*Y_SIZE+y;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 match = false; 105 match = false;
106 } 106 }
107 } 107 }
108 } 108 }
109 109
110 REPORTER_ASSERT(reporter, match); 110 REPORTER_ASSERT(reporter, match);
111 } 111 }
112 } 112 }
113 113
114 #endif 114 #endif
OLDNEW
« no previous file with comments | « tests/ReadPixelsTest.cpp ('k') | tests/RecordReplaceDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698