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

Side by Side Diff: include/gpu/GrRenderTarget.h

Issue 211683002: Add discard API to SkCanvas, plumb it to glDiscardFramebuffer() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: move to ToT Created 6 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 | Annotate | Revision Log
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkCanvas.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 GrRenderTarget_DEFINED 8 #ifndef GrRenderTarget_DEFINED
9 #define GrRenderTarget_DEFINED 9 #define GrRenderTarget_DEFINED
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 const SkIRect& getResolveRect() const { return fResolveRect; } 114 const SkIRect& getResolveRect() const { return fResolveRect; }
115 115
116 /** 116 /**
117 * If the render target is multisampled this will perform a multisample 117 * If the render target is multisampled this will perform a multisample
118 * resolve. Any pending draws to the target are first flushed. This only 118 * resolve. Any pending draws to the target are first flushed. This only
119 * applies to render targets that are associated with GrTextures. After the 119 * applies to render targets that are associated with GrTextures. After the
120 * function returns the GrTexture will contain the resolved pixels. 120 * function returns the GrTexture will contain the resolved pixels.
121 */ 121 */
122 void resolve(); 122 void resolve();
123 123
124 /**
125 * Provide a performance hint that the render target's contents are allowed
126 * to become undefined.
127 */
128 void discard();
129
124 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO 130 // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO
125 // 0 in GL), or be unresolvable because the client didn't give us the 131 // 0 in GL), or be unresolvable because the client didn't give us the
126 // resolve destination. 132 // resolve destination.
127 enum ResolveType { 133 enum ResolveType {
128 kCanResolve_ResolveType, 134 kCanResolve_ResolveType,
129 kAutoResolves_ResolveType, 135 kAutoResolves_ResolveType,
130 kCantResolve_ResolveType, 136 kCantResolve_ResolveType,
131 }; 137 };
132 virtual ResolveType getResolveType() const = 0; 138 virtual ResolveType getResolveType() const = 0;
133 139
(...skipping 28 matching lines...) Expand all
162 168
163 GrStencilBuffer* fStencilBuffer; 169 GrStencilBuffer* fStencilBuffer;
164 GrTexture* fTexture; // not ref'ed 170 GrTexture* fTexture; // not ref'ed
165 171
166 SkIRect fResolveRect; 172 SkIRect fResolveRect;
167 173
168 typedef GrSurface INHERITED; 174 typedef GrSurface INHERITED;
169 }; 175 };
170 176
171 #endif 177 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698