Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: src/gpu/gl/GrGLGpu.h

Issue 1541903002: added support for PLS path rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for ASAN failure Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, 128 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h,
129 GrPixelConfig config) const override; 129 GrPixelConfig config) const override;
130 bool isTestingOnlyBackendTexture(GrBackendObject) const override; 130 bool isTestingOnlyBackendTexture(GrBackendObject) const override;
131 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c onst override; 131 void deleteTestingOnlyBackendTexture(GrBackendObject, bool abandonTexture) c onst override;
132 132
133 void resetShaderCacheForTesting() const override; 133 void resetShaderCacheForTesting() const override;
134 134
135 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override; 135 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override;
136 136
137 void performFlushWorkaround() override;
138
137 private: 139 private:
138 GrGLGpu(GrGLContext* ctx, GrContext* context); 140 GrGLGpu(GrGLContext* ctx, GrContext* context);
139 141
140 // GrGpu overrides 142 // GrGpu overrides
141 void onResetContext(uint32_t resetBits) override; 143 void onResetContext(uint32_t resetBits) override;
142 144
143 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; 145 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override;
144 146
145 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle, 147 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc le lifeCycle,
146 const void* srcData, size_t rowBytes) override; 148 const void* srcData, size_t rowBytes) override;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 const SkIPoint& dstPoint); 229 const SkIPoint& dstPoint);
228 void copySurfaceAsCopyTexSubImage(GrSurface* dst, 230 void copySurfaceAsCopyTexSubImage(GrSurface* dst,
229 GrSurface* src, 231 GrSurface* src,
230 const SkIRect& srcRect, 232 const SkIRect& srcRect,
231 const SkIPoint& dstPoint); 233 const SkIPoint& dstPoint);
232 bool copySurfaceAsBlitFramebuffer(GrSurface* dst, 234 bool copySurfaceAsBlitFramebuffer(GrSurface* dst,
233 GrSurface* src, 235 GrSurface* src,
234 const SkIRect& srcRect, 236 const SkIRect& srcRect,
235 const SkIPoint& dstPoint); 237 const SkIPoint& dstPoint);
236 238
239 void stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGLint p osXformUniform,
240 GrGLuint arrayBuffer);
241
242 void setupPixelLocalStorage(const DrawArgs& args);
243
237 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff); 244 static bool BlendCoeffReferencesConstant(GrBlendCoeff coeff);
238 245
239 class ProgramCache : public ::SkNoncopyable { 246 class ProgramCache : public ::SkNoncopyable {
240 public: 247 public:
241 ProgramCache(GrGLGpu* gpu); 248 ProgramCache(GrGLGpu* gpu);
242 ~ProgramCache(); 249 ~ProgramCache();
243 250
244 void reset(); 251 void reset();
245 void abandon(); 252 void abandon();
246 GrGLProgram* refProgram(const DrawArgs&); 253 GrGLProgram* refProgram(const DrawArgs&);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 355
349 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying. 356 // Must be called if bindSurfaceFBOForCopy was used to bind a surface for co pying.
350 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface); 357 void unbindTextureFBOForCopy(GrGLenum fboTarget, GrSurface* surface);
351 358
352 SkAutoTUnref<GrGLContext> fGLContext; 359 SkAutoTUnref<GrGLContext> fGLContext;
353 360
354 void createCopyPrograms(); 361 void createCopyPrograms();
355 void createWireRectProgram(); 362 void createWireRectProgram();
356 void createUnitRectBuffer(); 363 void createUnitRectBuffer();
357 364
365 void createPLSSetupProgram();
366
358 // GL program-related state 367 // GL program-related state
359 ProgramCache* fProgramCache; 368 ProgramCache* fProgramCache;
360 369
361 /////////////////////////////////////////////////////////////////////////// 370 ///////////////////////////////////////////////////////////////////////////
362 ///@name Caching of GL State 371 ///@name Caching of GL State
363 ///@{ 372 ///@{
364 int fHWActiveTextureUnitIdx; 373 int fHWActiveTextureUnitIdx;
365 GrGLuint fHWProgramID; 374 GrGLuint fHWProgramID;
366 375
367 enum TriState { 376 enum TriState {
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 case GR_GL_TEXTURE_EXTERNAL: 567 case GR_GL_TEXTURE_EXTERNAL:
559 return 1; 568 return 1;
560 case GR_GL_TEXTURE_RECTANGLE: 569 case GR_GL_TEXTURE_RECTANGLE:
561 return 2; 570 return 2;
562 default: 571 default:
563 SkFAIL("Unexpected texture target type."); 572 SkFAIL("Unexpected texture target type.");
564 return 0; 573 return 0;
565 } 574 }
566 } 575 }
567 576
577 struct {
578 GrGLuint fProgram;
579 GrGLint fPosXformUniform;
580 GrGLuint fArrayBuffer;
581 } fPLSSetupProgram;
582
583 bool fHWPLSEnabled;
584 bool fPLSHasBeenUsed;
585
568 typedef GrGpu INHERITED; 586 typedef GrGpu INHERITED;
569 friend class GrGLPathRendering; // For accessing setTextureUnit. 587 friend class GrGLPathRendering; // For accessing setTextureUnit.
570 }; 588 };
571 589
572 #endif 590 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLDefines.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698