| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 const SkIRect& srcRect, | 101 const SkIRect& srcRect, |
| 102 const SkIPoint& dstPoint) override; | 102 const SkIPoint& dstPoint) override; |
| 103 | 103 |
| 104 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 104 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
| 105 | 105 |
| 106 void buildProgramDesc(GrProgramDesc*, | 106 void buildProgramDesc(GrProgramDesc*, |
| 107 const GrPrimitiveProcessor&, | 107 const GrPrimitiveProcessor&, |
| 108 const GrPipeline&, | 108 const GrPipeline&, |
| 109 const GrBatchTracker&) const override; | 109 const GrBatchTracker&) const override; |
| 110 | 110 |
| 111 const GrGLContext* glContextForTesting() const override { | 111 GrBackendObject createBackendTexture(void* pixels, int w, int h, |
| 112 return &this->glContext(); | 112 GrPixelConfig config) const override; |
| 113 } | 113 bool isBackendTexture(GrBackendObject id) const override; |
| 114 void deleteBackendTexture(GrBackendObject id) const override; |
| 114 | 115 |
| 115 private: | 116 private: |
| 116 GrGLGpu(GrGLContext* ctx, GrContext* context); | 117 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 117 | 118 |
| 118 // GrGpu overrides | 119 // GrGpu overrides |
| 119 void onResetContext(uint32_t resetBits) override; | 120 void onResetContext(uint32_t resetBits) override; |
| 120 | 121 |
| 121 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 122 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
| 122 const void* srcData, size_t rowBytes) override; | 123 const void* srcData, size_t rowBytes) override; |
| 123 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 124 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 // NULL means whole target. Can be an empty rect. | 259 // NULL means whole target. Can be an empty rect. |
| 259 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); | 260 void flushRenderTarget(GrGLRenderTarget*, const SkIRect* bounds); |
| 260 | 261 |
| 261 void flushStencil(const GrStencilSettings&); | 262 void flushStencil(const GrStencilSettings&); |
| 262 void flushHWAAState(GrRenderTarget* rt, bool useHWAA); | 263 void flushHWAAState(GrRenderTarget* rt, bool useHWAA); |
| 263 | 264 |
| 264 bool configToGLFormats(GrPixelConfig config, | 265 bool configToGLFormats(GrPixelConfig config, |
| 265 bool getSizedInternal, | 266 bool getSizedInternal, |
| 266 GrGLenum* internalFormat, | 267 GrGLenum* internalFormat, |
| 267 GrGLenum* externalFormat, | 268 GrGLenum* externalFormat, |
| 268 GrGLenum* externalType); | 269 GrGLenum* externalType) const; |
| 269 // helper for onCreateTexture and writeTexturePixels | 270 // helper for onCreateTexture and writeTexturePixels |
| 270 bool uploadTexData(const GrSurfaceDesc& desc, | 271 bool uploadTexData(const GrSurfaceDesc& desc, |
| 271 bool isNewTexture, | 272 bool isNewTexture, |
| 272 int left, int top, int width, int height, | 273 int left, int top, int width, int height, |
| 273 GrPixelConfig dataConfig, | 274 GrPixelConfig dataConfig, |
| 274 const void* data, | 275 const void* data, |
| 275 size_t rowBytes); | 276 size_t rowBytes); |
| 276 | 277 |
| 277 // helper for onCreateCompressedTexture. If width and height are | 278 // helper for onCreateCompressedTexture. If width and height are |
| 278 // set to -1, then this function will use desc.fWidth and desc.fHeight | 279 // set to -1, then this function will use desc.fWidth and desc.fHeight |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 | 496 |
| 496 // we record what stencil format worked last time to hopefully exit early | 497 // we record what stencil format worked last time to hopefully exit early |
| 497 // from our loop that tries stencil formats and calls check fb status. | 498 // from our loop that tries stencil formats and calls check fb status. |
| 498 int fLastSuccessfulStencilFmtIdx; | 499 int fLastSuccessfulStencilFmtIdx; |
| 499 | 500 |
| 500 typedef GrGpu INHERITED; | 501 typedef GrGpu INHERITED; |
| 501 friend class GrGLPathRendering; // For accessing setTextureUnit. | 502 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 502 }; | 503 }; |
| 503 | 504 |
| 504 #endif | 505 #endif |
| OLD | NEW |