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

Side by Side Diff: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp

Issue 1154163012: Fix edge-line artifacts issue on Mali (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « 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 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 #include "GrGLVertexShaderBuilder.h" 8 #include "GrGLVertexShaderBuilder.h"
9 #include "GrGLProgramBuilder.h" 9 #include "GrGLProgramBuilder.h"
10 #include "../GrGLGpu.h" 10 #include "../GrGLGpu.h"
(...skipping 18 matching lines...) Expand all
29 int vaCount = gp.numAttribs(); 29 int vaCount = gp.numAttribs();
30 for (int i = 0; i < vaCount; i++) { 30 for (int i = 0; i < vaCount; i++) {
31 this->addAttribute(&gp.getAttrib(i)); 31 this->addAttribute(&gp.getAttrib(i));
32 } 32 }
33 return; 33 return;
34 } 34 }
35 35
36 void GrGLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posV ar) { 36 void GrGLVertexBuilder::transformToNormalizedDeviceSpace(const GrShaderVar& posV ar) {
37 SkASSERT(!fRtAdjustName); 37 SkASSERT(!fRtAdjustName);
38 38
39 GrSLPrecision precision = kDefault_GrSLPrecision;
40 if (fProgramBuilder->ctxInfo().vendor() == kARM_GrGLVendor) {
41 precision = kHigh_GrSLPrecision;
42 }
43
39 // setup RT Uniform 44 // setup RT Uniform
40 fProgramBuilder->fUniformHandles.fRTAdjustmentUni = 45 fProgramBuilder->fUniformHandles.fRTAdjustmentUni =
41 fProgramBuilder->addUniform(GrGLProgramBuilder::kVertex_Visibility, 46 fProgramBuilder->addUniform(GrGLProgramBuilder::kVertex_Visibility,
42 kVec4f_GrSLType, kDefault_GrSLPrecision, 47 kVec4f_GrSLType, precision,
43 fProgramBuilder->rtAdjustment(), 48 fProgramBuilder->rtAdjustment(),
44 &fRtAdjustName); 49 &fRtAdjustName);
45 if (this->getProgramBuilder()->desc().header().fSnapVerticesToPixelCenters) { 50 if (this->getProgramBuilder()->desc().header().fSnapVerticesToPixelCenters) {
46 if (kVec3f_GrSLType == posVar.getType()) { 51 if (kVec3f_GrSLType == posVar.getType()) {
47 const char* p = posVar.c_str(); 52 const char* p = posVar.c_str();
48 this->codeAppendf("{vec2 _posTmp = vec2(%s.x/%s.z, %s.y/%s.z);", p, p, p, p); 53 this->codeAppendf("{vec2 _posTmp = vec2(%s.x/%s.z, %s.y/%s.z);", p, p, p, p);
49 } else { 54 } else {
50 SkASSERT(kVec2f_GrSLType == posVar.getType()); 55 SkASSERT(kVec2f_GrSLType == posVar.getType());
51 this->codeAppendf("{vec2 _posTmp = %s;", posVar.c_str()); 56 this->codeAppendf("{vec2 _posTmp = %s;", posVar.c_str());
52 } 57 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for (int i = 0; i < fInputs.count(); ++i) { 98 for (int i = 0; i < fInputs.count(); ++i) {
94 const GrGLShaderVar& attr = fInputs[i]; 99 const GrGLShaderVar& attr = fInputs[i];
95 // if attribute already added, don't add it again 100 // if attribute already added, don't add it again
96 if (attr.getName().equals(var.getName())) { 101 if (attr.getName().equals(var.getName())) {
97 return false; 102 return false;
98 } 103 }
99 } 104 }
100 fInputs.push_back(var); 105 fInputs.push_back(var);
101 return true; 106 return true;
102 } 107 }
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