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

Side by Side Diff: bench/GLBench.cpp

Issue 1386643002: S4 only has 8 texture units on the GLContext we create (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | 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 2015 Google Inc. 2 * Copyright 2015 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 "GLBench.h" 8 #include "GLBench.h"
9 9
10 #if SK_SUPPORT_GPU 10 #if SK_SUPPORT_GPU
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 GR_GL_CALL(gl, DeleteShader(vertexShader)); 103 GR_GL_CALL(gl, DeleteShader(vertexShader));
104 GR_GL_CALL(gl, DeleteShader(fragmentShader)); 104 GR_GL_CALL(gl, DeleteShader(fragmentShader));
105 105
106 return shaderProgram; 106 return shaderProgram;
107 } 107 }
108 108
109 GrGLuint GLBench::SetupFramebuffer(const GrGLInterface* gl, int screenWidth, int screenHeight) { 109 GrGLuint GLBench::SetupFramebuffer(const GrGLInterface* gl, int screenWidth, int screenHeight) {
110 //Setup framebuffer 110 //Setup framebuffer
111 GrGLuint texture; 111 GrGLuint texture;
112 GR_GL_CALL(gl, GenTextures(1, &texture)); 112 GR_GL_CALL(gl, GenTextures(1, &texture));
113 GR_GL_CALL(gl, ActiveTexture(GR_GL_TEXTURE15)); 113 GR_GL_CALL(gl, ActiveTexture(GR_GL_TEXTURE7));
114 GR_GL_CALL(gl, BindTexture(GR_GL_TEXTURE_2D, texture)); 114 GR_GL_CALL(gl, BindTexture(GR_GL_TEXTURE_2D, texture));
115 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MAG_FILTER, GR_ GL_NEAREST)); 115 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MAG_FILTER, GR_ GL_NEAREST));
116 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MIN_FILTER, GR_ GL_NEAREST)); 116 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_MIN_FILTER, GR_ GL_NEAREST));
117 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_S, GR_GL_C LAMP_TO_EDGE)); 117 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_S, GR_GL_C LAMP_TO_EDGE));
118 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_T, GR_GL_C LAMP_TO_EDGE)); 118 GR_GL_CALL(gl, TexParameteri(GR_GL_TEXTURE_2D, GR_GL_TEXTURE_WRAP_T, GR_GL_C LAMP_TO_EDGE));
119 GR_GL_CALL(gl, TexImage2D(GR_GL_TEXTURE_2D, 119 GR_GL_CALL(gl, TexImage2D(GR_GL_TEXTURE_2D,
120 0, //level 120 0, //level
121 GR_GL_RGBA, //internal format 121 GR_GL_RGBA, //internal format
122 screenWidth, // width 122 screenWidth, // width
123 screenHeight, // height 123 screenHeight, // height
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 bm.setPixels(readback.get()); 163 bm.setPixels(readback.get());
164 164
165 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) { 165 if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100 )) {
166 SkDebugf("------ failed to encode %s\n", filename); 166 SkDebugf("------ failed to encode %s\n", filename);
167 remove(filename); // remove any partial file 167 remove(filename); // remove any partial file
168 return; 168 return;
169 } 169 }
170 } 170 }
171 171
172 #endif 172 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698