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

Side by Side Diff: tests/FloatingPointTextureTest.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/ClipCacheTest.cpp ('k') | tests/GLProgramsTest.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 2014 Google Inc. 2 * Copyright 2014 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 /* 8 /*
9 * This is a straightforward test of floating point textures, which are 9 * This is a straightforward test of floating point textures, which are
10 * supported on some platforms. As of right now, this test only supports 10 * supported on some platforms. As of right now, this test only supports
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 GrContextFactory::GLContextType type = 52 GrContextFactory::GLContextType type =
53 static_cast<GrContextFactory::GLContextType>(glCtxType); 53 static_cast<GrContextFactory::GLContextType>(glCtxType);
54 if (!GrContextFactory::IsRenderingGLContext(type)) { 54 if (!GrContextFactory::IsRenderingGLContext(type)) {
55 continue; 55 continue;
56 } 56 }
57 GrContext* context = factory->get(type); 57 GrContext* context = factory->get(type);
58 if (NULL == context){ 58 if (NULL == context){
59 continue; 59 continue;
60 } 60 }
61 61
62 SkAutoTUnref<GrTexture> fpTexture( 62 SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false ,
63 context->createUncachedTexture(desc, controlPixelData.begin( ), 0)); 63 controlPixe lData.begin(), 0));
64 // Floating point textures are NOT supported everywhere 64 // Floating point textures are NOT supported everywhere
65 if (NULL == fpTexture) { 65 if (NULL == fpTexture) {
66 continue; 66 continue;
67 } 67 }
68 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0); 68 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0);
69 REPORTER_ASSERT(reporter, 69 REPORTER_ASSERT(reporter,
70 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re adBuffer.bytes())); 70 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re adBuffer.bytes()));
71 } 71 }
72 } 72 }
73 } 73 }
(...skipping 25 matching lines...) Expand all
99 GrContextFactory::GLContextType type = 99 GrContextFactory::GLContextType type =
100 static_cast<GrContextFactory::GLContextType>(glCtxType); 100 static_cast<GrContextFactory::GLContextType>(glCtxType);
101 if (!GrContextFactory::IsRenderingGLContext(type)) { 101 if (!GrContextFactory::IsRenderingGLContext(type)) {
102 continue; 102 continue;
103 } 103 }
104 GrContext* context = factory->get(type); 104 GrContext* context = factory->get(type);
105 if (NULL == context){ 105 if (NULL == context){
106 continue; 106 continue;
107 } 107 }
108 108
109 SkAutoTUnref<GrTexture> fpTexture( 109 SkAutoTUnref<GrTexture> fpTexture(context->createTexture(desc, false ,
110 context->createUncachedTexture(desc, controlPixelData.begin( ), 0)); 110 controlPixe lData.begin(), 0));
111 // 16-bit floating point textures are NOT supported everywhere 111 // 16-bit floating point textures are NOT supported everywhere
112 if (NULL == fpTexture) { 112 if (NULL == fpTexture) {
113 continue; 113 continue;
114 } 114 }
115 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0); 115 fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.b egin(), 0);
116 REPORTER_ASSERT(reporter, 116 REPORTER_ASSERT(reporter,
117 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re adBuffer.bytes())); 117 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), re adBuffer.bytes()));
118 } 118 }
119 } 119 }
120 } 120 }
121 121
122 #endif 122 #endif
OLDNEW
« no previous file with comments | « tests/ClipCacheTest.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698