| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |