OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef GrGpu_DEFINED | 10 #ifndef GrGpu_DEFINED |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 void resolveRenderTarget(GrRenderTarget* target); | 145 void resolveRenderTarget(GrRenderTarget* target); |
146 | 146 |
147 /** | 147 /** |
148 * Ensures that the current render target is actually set in the | 148 * Ensures that the current render target is actually set in the |
149 * underlying 3D API. Used when client wants to use 3D API to directly | 149 * underlying 3D API. Used when client wants to use 3D API to directly |
150 * render to the RT. | 150 * render to the RT. |
151 */ | 151 */ |
152 void forceRenderTargetFlush(); | 152 void forceRenderTargetFlush(); |
153 | 153 |
154 /** | 154 /** |
155 * Gets a preferred 8888 config to use for writing / reading pixel data. The
returned config | 155 * Gets a preferred 8888 config to use for writing/reading pixel data to/fro
m a surface with |
156 * must have at least as many bits per channel as the config param. | 156 * config surfaceConfig. The returned config must have at least as many bits
per channel as the |
| 157 * readConfig or writeConfig param. |
157 */ | 158 */ |
158 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig config) const
{ return config; } | 159 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, |
159 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig config) const
{ return config; } | 160 GrPixelConfig surfaceConfig)
const { |
| 161 return readConfig; |
| 162 } |
| 163 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, |
| 164 GrPixelConfig surfaceConfig
) const { |
| 165 return writeConfig; |
| 166 } |
160 | 167 |
161 /** | 168 /** |
162 * Called before uploading writing pixels to a GrTexture when the src pixel
config doesn't | 169 * Called before uploading writing pixels to a GrTexture when the src pixel
config doesn't |
163 * match the texture's config. | 170 * match the texture's config. |
164 */ | 171 */ |
165 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig
) const = 0; | 172 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig
) const = 0; |
166 | 173 |
167 /** | 174 /** |
168 * OpenGL's readPixels returns the result bottom-to-top while the skia | 175 * OpenGL's readPixels returns the result bottom-to-top while the skia |
169 * API is top-to-bottom. Thus we have to do a y-axis flip. The obvious | 176 * API is top-to-bottom. Thus we have to do a y-axis flip. The obvious |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 mutable GrIndexBuffer* fQuadInd
exBuffer; | 531 mutable GrIndexBuffer* fQuadInd
exBuffer; |
525 bool fContext
IsDirty; | 532 bool fContext
IsDirty; |
526 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 533 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
527 // functionality to GrResourceCache. | 534 // functionality to GrResourceCache. |
528 ResourceList fResourc
eList; | 535 ResourceList fResourc
eList; |
529 | 536 |
530 typedef GrDrawTarget INHERITED; | 537 typedef GrDrawTarget INHERITED; |
531 }; | 538 }; |
532 | 539 |
533 #endif | 540 #endif |
OLD | NEW |