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 #include "GrGLGpu.h" | 8 #include "GrGLGpu.h" |
9 #include "GrGLBuffer.h" | 9 #include "GrGLBuffer.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 fWireRectArrayBuffer.reset(); | 472 fWireRectArrayBuffer.reset(); |
473 fPLSSetupProgram.fProgram = 0; | 473 fPLSSetupProgram.fProgram = 0; |
474 fPLSSetupProgram.fArrayBuffer.reset(); | 474 fPLSSetupProgram.fArrayBuffer.reset(); |
475 if (this->glCaps().shaderCaps()->pathRenderingSupport()) { | 475 if (this->glCaps().shaderCaps()->pathRenderingSupport()) { |
476 this->glPathRendering()->disconnect(type); | 476 this->glPathRendering()->disconnect(type); |
477 } | 477 } |
478 } | 478 } |
479 | 479 |
480 /////////////////////////////////////////////////////////////////////////////// | 480 /////////////////////////////////////////////////////////////////////////////// |
481 | 481 |
482 InstancedRendering* GrGLGpu::createInstancedRenderingIfSupported() { | |
483 return GLInstancedRendering::CreateIfSupported(this); | |
484 } | |
485 | |
486 void GrGLGpu::onResetContext(uint32_t resetBits) { | 482 void GrGLGpu::onResetContext(uint32_t resetBits) { |
487 // we don't use the zb at all | 483 // we don't use the zb at all |
488 if (resetBits & kMisc_GrGLBackendState) { | 484 if (resetBits & kMisc_GrGLBackendState) { |
489 GL_CALL(Disable(GR_GL_DEPTH_TEST)); | 485 GL_CALL(Disable(GR_GL_DEPTH_TEST)); |
490 GL_CALL(DepthMask(GR_GL_FALSE)); | 486 GL_CALL(DepthMask(GR_GL_FALSE)); |
491 | 487 |
492 fHWBufferState[kTexel_GrBufferType].invalidate(); | 488 fHWBufferState[kTexel_GrBufferType].invalidate(); |
493 fHWBufferState[kDrawIndirect_GrBufferType].invalidate(); | 489 fHWBufferState[kDrawIndirect_GrBufferType].invalidate(); |
494 fHWBufferState[kXferCpuToGpu_GrBufferType].invalidate(); | 490 fHWBufferState[kXferCpuToGpu_GrBufferType].invalidate(); |
495 fHWBufferState[kXferGpuToCpu_GrBufferType].invalidate(); | 491 fHWBufferState[kXferGpuToCpu_GrBufferType].invalidate(); |
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 | 1954 |
1959 // GL_STREAM_DRAW triggers an optimization in Chromium's GPU process where a cli
ent's vertex buffer | 1955 // GL_STREAM_DRAW triggers an optimization in Chromium's GPU process where a cli
ent's vertex buffer |
1960 // objects are implemented as client-side-arrays on tile-deferred architectures. | 1956 // objects are implemented as client-side-arrays on tile-deferred architectures. |
1961 #define DYNAMIC_USAGE_PARAM GR_GL_STREAM_DRAW | 1957 #define DYNAMIC_USAGE_PARAM GR_GL_STREAM_DRAW |
1962 | 1958 |
1963 GrBuffer* GrGLGpu::onCreateBuffer(size_t size, GrBufferType intendedType, | 1959 GrBuffer* GrGLGpu::onCreateBuffer(size_t size, GrBufferType intendedType, |
1964 GrAccessPattern accessPattern, const void* dat
a) { | 1960 GrAccessPattern accessPattern, const void* dat
a) { |
1965 return GrGLBuffer::Create(this, size, intendedType, accessPattern, data); | 1961 return GrGLBuffer::Create(this, size, intendedType, accessPattern, data); |
1966 } | 1962 } |
1967 | 1963 |
| 1964 InstancedRendering* GrGLGpu::onCreateInstancedRendering() { |
| 1965 return new GLInstancedRendering(this); |
| 1966 } |
| 1967 |
1968 void GrGLGpu::flushScissor(const GrScissorState& scissorState, | 1968 void GrGLGpu::flushScissor(const GrScissorState& scissorState, |
1969 const GrGLIRect& rtViewport, | 1969 const GrGLIRect& rtViewport, |
1970 GrSurfaceOrigin rtOrigin) { | 1970 GrSurfaceOrigin rtOrigin) { |
1971 if (scissorState.enabled()) { | 1971 if (scissorState.enabled()) { |
1972 GrGLIRect scissor; | 1972 GrGLIRect scissor; |
1973 scissor.setRelativeTo(rtViewport, | 1973 scissor.setRelativeTo(rtViewport, |
1974 scissorState.rect().fLeft, | 1974 scissorState.rect().fLeft, |
1975 scissorState.rect().fTop, | 1975 scissorState.rect().fTop, |
1976 scissorState.rect().width(), | 1976 scissorState.rect().width(), |
1977 scissorState.rect().height(), | 1977 scissorState.rect().height(), |
(...skipping 2635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4613 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || | 4613 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || |
4614 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { | 4614 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { |
4615 copyParams->fFilter = GrTextureParams::kNone_FilterMode; | 4615 copyParams->fFilter = GrTextureParams::kNone_FilterMode; |
4616 copyParams->fWidth = texture->width(); | 4616 copyParams->fWidth = texture->width(); |
4617 copyParams->fHeight = texture->height(); | 4617 copyParams->fHeight = texture->height(); |
4618 return true; | 4618 return true; |
4619 } | 4619 } |
4620 } | 4620 } |
4621 return false; | 4621 return false; |
4622 } | 4622 } |
OLD | NEW |