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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 void onGetMultisampleSpecs(GrRenderTarget*, const GrStencilSettings&, | 224 void onGetMultisampleSpecs(GrRenderTarget*, const GrStencilSettings&, |
225 int* effectiveSampleCnt, SamplePattern*) override
; | 225 int* effectiveSampleCnt, SamplePattern*) override
; |
226 | 226 |
227 // binds texture unit in GL | 227 // binds texture unit in GL |
228 void setTextureUnit(int unitIdx); | 228 void setTextureUnit(int unitIdx); |
229 | 229 |
230 void setTextureSwizzle(int unitIdx, GrGLenum target, const GrGLenum swizzle[
]); | 230 void setTextureSwizzle(int unitIdx, GrGLenum target, const GrGLenum swizzle[
]); |
231 | 231 |
232 // Flushes state from GrPipeline to GL. Returns false if the state couldn't
be set. | 232 // Flushes state from GrPipeline to GL. Returns false if the state couldn't
be set. |
233 bool flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& pr
imProc); | 233 // willDrawPoints must be true if point primitives will be rendered after se
tting the GL state. |
| 234 bool flushGLState(const GrPipeline&, const GrPrimitiveProcessor&, bool willD
rawPoints); |
234 | 235 |
235 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset | 236 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt
es gives the offset |
236 // an into the index buffer. It does not account for vertices.startIndex() b
ut rather the start | 237 // an into the index buffer. It does not account for vertices.startIndex() b
ut rather the start |
237 // index is relative to the returned offset. | 238 // index is relative to the returned offset. |
238 void setupGeometry(const GrPrimitiveProcessor&, | 239 void setupGeometry(const GrPrimitiveProcessor&, |
239 const GrNonInstancedMesh& mesh, | 240 const GrNonInstancedMesh& mesh, |
240 size_t* indexOffsetInBytes); | 241 size_t* indexOffsetInBytes); |
241 | 242 |
242 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSwizzle
&); | 243 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSwizzle
&); |
243 | 244 |
(...skipping 18 matching lines...) Expand all Loading... |
262 void setupPixelLocalStorage(const GrPipeline&, const GrPrimitiveProcessor&); | 263 void setupPixelLocalStorage(const GrPipeline&, const GrPrimitiveProcessor&); |
263 | 264 |
264 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); | 265 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); |
265 | 266 |
266 class ProgramCache : public ::SkNoncopyable { | 267 class ProgramCache : public ::SkNoncopyable { |
267 public: | 268 public: |
268 ProgramCache(GrGLGpu* gpu); | 269 ProgramCache(GrGLGpu* gpu); |
269 ~ProgramCache(); | 270 ~ProgramCache(); |
270 | 271 |
271 void abandon(); | 272 void abandon(); |
272 GrGLProgram* refProgram(const GrGLGpu* gpu, const GrPipeline&, const GrP
rimitiveProcessor&); | 273 GrGLProgram* refProgram(const GrGLGpu*, const GrPipeline&, const GrPrimi
tiveProcessor&, |
| 274 bool hasPointSize); |
273 | 275 |
274 private: | 276 private: |
275 enum { | 277 enum { |
276 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new | 278 // We may actually have kMaxEntries+1 shaders in the GL context beca
use we create a new |
277 // shader before evicting from the cache. | 279 // shader before evicting from the cache. |
278 kMaxEntries = 128, | 280 kMaxEntries = 128, |
279 kHashBits = 6, | 281 kHashBits = 6, |
280 }; | 282 }; |
281 | 283 |
282 struct Entry; | 284 struct Entry; |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 bool fPLSHasBeenUsed; | 635 bool fPLSHasBeenUsed; |
634 | 636 |
635 float fHWMinSampleShading; | 637 float fHWMinSampleShading; |
636 | 638 |
637 typedef GrGpu INHERITED; | 639 typedef GrGpu INHERITED; |
638 friend class GrGLPathRendering; // For accessing setTextureUnit. | 640 friend class GrGLPathRendering; // For accessing setTextureUnit. |
639 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta
te. | 641 friend class gr_instanced::GLInstancedRendering; // For accessing flushGLSta
te. |
640 }; | 642 }; |
641 | 643 |
642 #endif | 644 #endif |
OLD | NEW |