Chromium Code Reviews| 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 #ifndef GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
| 9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 void buildProgramDesc(GrProgramDesc*, | 94 void buildProgramDesc(GrProgramDesc*, |
| 95 const GrPrimitiveProcessor&, | 95 const GrPrimitiveProcessor&, |
| 96 const GrPipeline&, | 96 const GrPipeline&, |
| 97 const GrBatchTracker&) const override; | 97 const GrBatchTracker&) const override; |
| 98 | 98 |
| 99 const GrGLContext* glContextForTesting() const override { | 99 const GrGLContext* glContextForTesting() const override { |
| 100 return &this->glContext(); | 100 return &this->glContext(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void clearStencil(GrRenderTarget*) override; | |
| 104 | |
| 105 void invalidateBoundRenderTarget() { | |
|
egdaniel
2015/09/11 17:59:49
Now needed since we're attaching the stencil in th
| |
| 106 fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID; | |
| 107 } | |
| 108 | |
| 109 | |
| 103 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, | 110 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
| 104 GrPixelConfig config) const override; | 111 GrPixelConfig config) const override; |
| 105 bool isTestingOnlyBackendTexture(GrBackendObject id) const override; | 112 bool isTestingOnlyBackendTexture(GrBackendObject id) const override; |
| 106 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override; | 113 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override; |
| 107 | 114 |
| 108 private: | 115 private: |
| 109 GrGLGpu(GrGLContext* ctx, GrContext* context); | 116 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 110 | 117 |
| 111 // GrGpu overrides | 118 // GrGpu overrides |
| 112 void onResetContext(uint32_t resetBits) override; | 119 void onResetContext(uint32_t resetBits) override; |
| 113 | 120 |
| 114 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 121 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
| 115 | 122 |
| 116 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, | 123 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, |
| 117 const void* srcData, size_t rowBytes) override; | 124 const void* srcData, size_t rowBytes) override; |
| 118 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 125 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 119 GrGpuResource::LifeCycle lifeCycle, | 126 GrGpuResource::LifeCycle lifeCycle, |
| 120 const void* srcData) override; | 127 const void* srcData) override; |
| 121 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 128 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
| 122 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 129 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
| 123 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; | 130 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership ) override; |
| 124 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 131 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
| 125 GrWrapOwnership) override; | 132 GrWrapOwnership) override; |
| 126 bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, i nt height) override; | 133 GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTa rget* rt, |
| 127 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, | 134 int width, |
| 128 GrRenderTarget* rt) override; | 135 int height) over ride; |
| 129 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a | 136 // Given a GrPixelConfig return the index into the stencil format array on G rGLCaps to a |
| 130 // compatible stencil format. | 137 // compatible stencil format. |
| 131 int getCompatibleStencilIndex(GrPixelConfig config); | 138 int getCompatibleStencilIndex(GrPixelConfig config); |
| 132 | 139 |
| 133 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; | 140 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; |
| 134 | 141 |
| 135 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; | 142 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli p) override; |
| 136 | 143 |
| 137 bool onReadPixels(GrSurface*, | 144 bool onReadPixels(GrSurface*, |
| 138 int left, int top, | 145 int left, int top, |
| 139 int width, int height, | 146 int width, int height, |
| 140 GrPixelConfig, | 147 GrPixelConfig, |
| 141 void* buffer, | 148 void* buffer, |
| 142 size_t rowBytes) override; | 149 size_t rowBytes) override; |
| 143 | 150 |
| 144 bool onWritePixels(GrSurface*, | 151 bool onWritePixels(GrSurface*, |
| 145 int left, int top, int width, int height, | 152 int left, int top, int width, int height, |
| 146 GrPixelConfig config, const void* buffer, | 153 GrPixelConfig config, const void* buffer, |
| 147 size_t rowBytes) override; | 154 size_t rowBytes) override; |
| 148 | 155 |
| 149 void onResolveRenderTarget(GrRenderTarget* target) override; | 156 void onResolveRenderTarget(GrRenderTarget* target) override; |
| 150 | 157 |
| 151 void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override; | 158 void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override; |
| 152 | 159 |
| 153 bool onCopySurface(GrSurface* dst, | 160 bool onCopySurface(GrSurface* dst, |
| 154 GrSurface* src, | 161 GrSurface* src, |
| 155 const SkIRect& srcRect, | 162 const SkIRect& srcRect, |
| 156 const SkIPoint& dstPoint) override; | 163 const SkIPoint& dstPoint) override; |
| 157 | 164 |
| 158 void clearStencil(GrRenderTarget*) override; | |
| 159 | |
| 160 // binds texture unit in GL | 165 // binds texture unit in GL |
| 161 void setTextureUnit(int unitIdx); | 166 void setTextureUnit(int unitIdx); |
| 162 | 167 |
| 163 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set. | 168 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set. |
| 164 bool flushGLState(const DrawArgs&); | 169 bool flushGLState(const DrawArgs&); |
| 165 | 170 |
| 166 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset | 171 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset |
| 167 // an into the index buffer. It does not account for vertices.startIndex() b ut rather the start | 172 // an into the index buffer. It does not account for vertices.startIndex() b ut rather the start |
| 168 // index is relative to the returned offset. | 173 // index is relative to the returned offset. |
| 169 void setupGeometry(const GrPrimitiveProcessor&, | 174 void setupGeometry(const GrPrimitiveProcessor&, |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 494 | 499 |
| 495 // Mapping of pixel configs to known supported stencil formats to be used | 500 // Mapping of pixel configs to known supported stencil formats to be used |
| 496 // when adding a stencil buffer to a framebuffer. | 501 // when adding a stencil buffer to a framebuffer. |
| 497 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; | 502 int fPixelConfigToStencilIndex[kGrPixelConfigCnt]; |
| 498 | 503 |
| 499 typedef GrGpu INHERITED; | 504 typedef GrGpu INHERITED; |
| 500 friend class GrGLPathRendering; // For accessing setTextureUnit. | 505 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 501 }; | 506 }; |
| 502 | 507 |
| 503 #endif | 508 #endif |
| OLD | NEW |