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