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

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

Issue 1584473002: Swizzle shader output and blend when using GL_RED to implement kAlpha_8_GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@hideformats
Patch Set: Address comments Created 4 years, 11 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/GrGLCaps.cpp ('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
11 #include "GrGLContext.h" 11 #include "GrGLContext.h"
12 #include "GrGLIRect.h" 12 #include "GrGLIRect.h"
13 #include "GrGLIndexBuffer.h" 13 #include "GrGLIndexBuffer.h"
14 #include "GrGLPathRendering.h" 14 #include "GrGLPathRendering.h"
15 #include "GrGLProgram.h" 15 #include "GrGLProgram.h"
16 #include "GrGLRenderTarget.h" 16 #include "GrGLRenderTarget.h"
17 #include "GrGLStencilAttachment.h" 17 #include "GrGLStencilAttachment.h"
18 #include "GrGLTexture.h" 18 #include "GrGLTexture.h"
19 #include "GrGLTransferBuffer.h" 19 #include "GrGLTransferBuffer.h"
20 #include "GrGLVertexArray.h" 20 #include "GrGLVertexArray.h"
21 #include "GrGLVertexBuffer.h" 21 #include "GrGLVertexBuffer.h"
22 #include "GrGpu.h" 22 #include "GrGpu.h"
23 #include "GrPipelineBuilder.h" 23 #include "GrPipelineBuilder.h"
24 #include "GrXferProcessor.h" 24 #include "GrXferProcessor.h"
25 #include "SkTypes.h" 25 #include "SkTypes.h"
26 26
27 class GrPipeline; 27 class GrPipeline;
28 class GrNonInstancedVertices; 28 class GrNonInstancedVertices;
29 class GrSwizzle;
29 30
30 #ifdef SK_DEVELOPER 31 #ifdef SK_DEVELOPER
31 #define PROGRAM_CACHE_STATS 32 #define PROGRAM_CACHE_STATS
32 #endif 33 #endif
33 34
34 class GrGLGpu : public GrGpu { 35 class GrGLGpu : public GrGpu {
35 public: 36 public:
36 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions & options, 37 static GrGpu* Create(GrBackendContext backendContext, const GrContextOptions & options,
37 GrContext* context); 38 GrContext* context);
38 ~GrGLGpu() override; 39 ~GrGLGpu() override;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set. 193 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set.
193 bool flushGLState(const DrawArgs&); 194 bool flushGLState(const DrawArgs&);
194 195
195 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset 196 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset
196 // an into the index buffer. It does not account for vertices.startIndex() b ut rather the start 197 // an into the index buffer. It does not account for vertices.startIndex() b ut rather the start
197 // index is relative to the returned offset. 198 // index is relative to the returned offset.
198 void setupGeometry(const GrPrimitiveProcessor&, 199 void setupGeometry(const GrPrimitiveProcessor&,
199 const GrNonInstancedVertices& vertices, 200 const GrNonInstancedVertices& vertices,
200 size_t* indexOffsetInBytes); 201 size_t* indexOffsetInBytes);
201 202
202 // Subclasses should call this to flush the blend state. 203 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo, const GrSwizzle &);
203 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo);
204 204
205 bool hasExtension(const char* ext) const { return fGLContext->hasExtension(e xt); } 205 bool hasExtension(const char* ext) const { return fGLContext->hasExtension(e xt); }
206 206
207 void copySurfaceAsDraw(GrSurface* dst, 207 void copySurfaceAsDraw(GrSurface* dst,
208 GrSurface* src, 208 GrSurface* src,
209 const SkIRect& srcRect, 209 const SkIRect& srcRect,
210 const SkIPoint& dstPoint); 210 const SkIPoint& dstPoint);
211 void copySurfaceAsCopyTexSubImage(GrSurface* dst, 211 void copySurfaceAsCopyTexSubImage(GrSurface* dst,
212 GrSurface* src, 212 GrSurface* src,
213 const SkIRect& srcRect, 213 const SkIRect& srcRect,
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL); 541 SkASSERT(target == GR_GL_TEXTURE_EXTERNAL);
542 return 1; 542 return 1;
543 } 543 }
544 } 544 }
545 545
546 typedef GrGpu INHERITED; 546 typedef GrGpu INHERITED;
547 friend class GrGLPathRendering; // For accessing setTextureUnit. 547 friend class GrGLPathRendering; // For accessing setTextureUnit.
548 }; 548 };
549 549
550 #endif 550 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698