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

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

Issue 1001503002: Implement support for mixed sampled render targets (Closed) Base URL: https://skia.googlesource.com/skia.git@mix1
Patch Set: Fixes and squash with 3rd commit Created 5 years, 9 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // GrDrawTarget overrides 161 // GrDrawTarget overrides
162 void didAddGpuTraceMarker() SK_OVERRIDE; 162 void didAddGpuTraceMarker() SK_OVERRIDE;
163 void didRemoveGpuTraceMarker() SK_OVERRIDE; 163 void didRemoveGpuTraceMarker() SK_OVERRIDE;
164 164
165 // binds texture unit in GL 165 // binds texture unit in GL
166 void setTextureUnit(int unitIdx); 166 void setTextureUnit(int unitIdx);
167 167
168 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set. 168 // Flushes state from GrPipeline to GL. Returns false if the state couldn't be set.
169 // TODO we only have need to know if this is a line draw for flushing AA sta te on some buggy 169 // TODO we only have need to know if this is a line draw for flushing AA sta te on some buggy
170 // hardware. Evaluate if this is really necessary anymore 170 // hardware. Evaluate if this is really necessary anymore
171 bool flushGLState(const DrawArgs&, bool isLineDraw); 171 bool flushGLState(const DrawArgs&, bool isLineDraw,
172 GrSampleConfig sampleConfig = kUnified_GrSampleConfig);
172 173
173 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset 174 // Sets up vertex attribute pointers and strides. On return indexOffsetInByt es gives the offset
174 // an into the index buffer. It does not account for drawInfo.startIndex() b ut rather the start 175 // an into the index buffer. It does not account for drawInfo.startIndex() b ut rather the start
175 // index is relative to the returned offset. 176 // index is relative to the returned offset.
176 void setupGeometry(const GrPrimitiveProcessor&, 177 void setupGeometry(const GrPrimitiveProcessor&,
177 const GrDrawTarget::DrawInfo& info, 178 const GrDrawTarget::DrawInfo& info,
178 size_t* indexOffsetInBytes); 179 size_t* indexOffsetInBytes);
179 180
180 // Subclasses should call this to flush the blend state. 181 // Subclasses should call this to flush the blend state.
181 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo); 182 void flushBlend(const GrXferProcessor::BlendInfo& blendInfo);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 264
264 // binds the FBO and returns the GL enum of the framebuffer target it was bo und to. 265 // binds the FBO and returns the GL enum of the framebuffer target it was bo und to.
265 GrGLenum bindFBO(FBOBinding, const GrGLFBO*); 266 GrGLenum bindFBO(FBOBinding, const GrGLFBO*);
266 // This version invokes a workaround for a bug in Chromium. It should be cal led before 267 // This version invokes a workaround for a bug in Chromium. It should be cal led before
267 // attachments are changed on a FBO. 268 // attachments are changed on a FBO.
268 GrGLenum bindFBOForAddingAttachments(const GrGLFBO*); 269 GrGLenum bindFBOForAddingAttachments(const GrGLFBO*);
269 270
270 void setViewport(const GrGLIRect& viewport); 271 void setViewport(const GrGLIRect& viewport);
271 272
272 void flushStencil(const GrStencilSettings&); 273 void flushStencil(const GrStencilSettings&);
273 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw); 274 void flushHWAAState(GrRenderTarget* rt, bool useHWAA, bool isLineDraw,
275 GrSampleConfig sampleConfig = kUnified_GrSampleConfig);
274 276
275 bool configToGLFormats(GrPixelConfig config, 277 bool configToGLFormats(GrPixelConfig config,
276 bool getSizedInternal, 278 bool getSizedInternal,
277 GrGLenum* internalFormat, 279 GrGLenum* internalFormat,
278 GrGLenum* externalFormat, 280 GrGLenum* externalFormat,
279 GrGLenum* externalType); 281 GrGLenum* externalType);
280 // helper for onCreateTexture and writeTexturePixels 282 // helper for onCreateTexture and writeTexturePixels
281 bool uploadTexData(const GrSurfaceDesc& desc, 283 bool uploadTexData(const GrSurfaceDesc& desc,
282 bool isNewTexture, 284 bool isNewTexture,
283 int left, int top, int width, int height, 285 int left, int top, int width, int height,
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 489
488 // we record what stencil format worked last time to hopefully exit early 490 // we record what stencil format worked last time to hopefully exit early
489 // from our loop that tries stencil formats and calls check fb status. 491 // from our loop that tries stencil formats and calls check fb status.
490 int fLastSuccessfulStencilFmtIdx; 492 int fLastSuccessfulStencilFmtIdx;
491 493
492 typedef GrGpu INHERITED; 494 typedef GrGpu INHERITED;
493 friend class GrGLPathRendering; // For accessing setTextureUnit. 495 friend class GrGLPathRendering; // For accessing setTextureUnit.
494 }; 496 };
495 497
496 #endif 498 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698