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

Side by Side Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1157943007: Disable unused attributes when using copy shader (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 2011 Google Inc. 2 * Copyright 2011 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 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLStencilAttachment.h" 10 #include "GrGLStencilAttachment.h"
(...skipping 2803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 2814
2815 GL_CALL(UseProgram(fCopyProgram.fProgram)); 2815 GL_CALL(UseProgram(fCopyProgram.fProgram));
2816 fHWProgramID = fCopyProgram.fProgram; 2816 fHWProgramID = fCopyProgram.fProgram;
2817 2817
2818 fHWGeometryState.setVertexArrayID(this, 0); 2818 fHWGeometryState.setVertexArrayID(this, 0);
2819 2819
2820 GrGLAttribArrayState* attribs = 2820 GrGLAttribArrayState* attribs =
2821 fHWGeometryState.bindArrayAndBufferToDraw(this, fCopyProgram.fArrayBuffe r); 2821 fHWGeometryState.bindArrayAndBufferToDraw(this, fCopyProgram.fArrayBuffe r);
2822 attribs->set(this, 0, fCopyProgram.fArrayBuffer, 2, GR_GL_FLOAT, false, 2822 attribs->set(this, 0, fCopyProgram.fArrayBuffer, 2, GR_GL_FLOAT, false,
2823 2 * sizeof(GrGLfloat), 0); 2823 2 * sizeof(GrGLfloat), 0);
2824 2824 attribs->disableUnusedArrays(this, 0x1);
2825 2825
2826 // dst rect edges in NDC (-1 to 1) 2826 // dst rect edges in NDC (-1 to 1)
2827 int dw = dst->width(); 2827 int dw = dst->width();
2828 int dh = dst->height(); 2828 int dh = dst->height();
2829 GrGLfloat dx0 = 2.f * dstPoint.fX / dw - 1.f; 2829 GrGLfloat dx0 = 2.f * dstPoint.fX / dw - 1.f;
2830 GrGLfloat dx1 = 2.f * (dstPoint.fX + w) / dw - 1.f; 2830 GrGLfloat dx1 = 2.f * (dstPoint.fX + w) / dw - 1.f;
2831 GrGLfloat dy0 = 2.f * dstPoint.fY / dh - 1.f; 2831 GrGLfloat dy0 = 2.f * dstPoint.fY / dh - 1.f;
2832 GrGLfloat dy1 = 2.f * (dstPoint.fY + h) / dh - 1.f; 2832 GrGLfloat dy1 = 2.f * (dstPoint.fY + h) / dh - 1.f;
2833 if (kBottomLeft_GrSurfaceOrigin == dst->origin()) { 2833 if (kBottomLeft_GrSurfaceOrigin == dst->origin()) {
2834 dy0 = -dy0; 2834 dy0 = -dy0;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 this->setVertexArrayID(gpu, 0); 3067 this->setVertexArrayID(gpu, 0);
3068 } 3068 }
3069 int attrCount = gpu->glCaps().maxVertexAttributes(); 3069 int attrCount = gpu->glCaps().maxVertexAttributes();
3070 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3070 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3071 fDefaultVertexArrayAttribState.resize(attrCount); 3071 fDefaultVertexArrayAttribState.resize(attrCount);
3072 } 3072 }
3073 attribState = &fDefaultVertexArrayAttribState; 3073 attribState = &fDefaultVertexArrayAttribState;
3074 } 3074 }
3075 return attribState; 3075 return attribState;
3076 } 3076 }
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