epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 1 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame^] | 10 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 11 | #ifndef GrTexture_DEFINED |
| 12 | #define GrTexture_DEFINED |
| 13 | |
| 14 | #include "GrRefCnt.h" |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 15 | #include "GrClip.h" |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 16 | #include "GrResource.h" |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 17 | |
| 18 | class GrTexture; |
| 19 | |
| 20 | /** |
| 21 | * GrRenderTarget represents a 2D buffer of pixels that can be rendered to. |
| 22 | * A context's render target is set by setRenderTarget(). Render targets are |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 23 | * created by a createTexture with the kRenderTarget_TextureFlag flag. |
| 24 | * Additionally, GrContext provides methods for creating GrRenderTargets |
| 25 | * that wrap externally created render targets. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 26 | */ |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 27 | class GrRenderTarget : public GrResource { |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 28 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 29 | public: |
| 30 | /** |
| 31 | * @return the width of the rendertarget |
| 32 | */ |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 33 | int width() const { return fWidth; } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 34 | /** |
| 35 | * @return the height of the rendertarget |
| 36 | */ |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 37 | int height() const { return fHeight; } |
| 38 | |
| 39 | /** |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 40 | * @return the pixel config. Can be kUnknown_GrPixelConfig |
| 41 | * if client asked us to render to a target that has a pixel |
| 42 | * config that isn't equivalent with one of our configs. |
| 43 | */ |
| 44 | int config() const { return fConfig; } |
| 45 | |
| 46 | /** |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 47 | * @return the number of stencil bits in the rendertarget |
| 48 | */ |
| 49 | int stencilBits() const { return fStencilBits; } |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 50 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 51 | /** |
| 52 | * @return the texture associated with the rendertarget, may be NULL. |
| 53 | */ |
| 54 | GrTexture* asTexture() {return fTexture;} |
| 55 | |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 56 | /** |
bsalomon@google.com | 0b96a84 | 2011-07-13 21:53:49 +0000 | [diff] [blame] | 57 | * If this RT is multisampled, this is the multisample buffer |
| 58 | * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL) |
| 59 | */ |
| 60 | virtual intptr_t getRenderTargetHandle() const = 0; |
| 61 | |
| 62 | /** |
| 63 | * If this RT is multisampled, this is the buffer it is resolved to. |
| 64 | * Otherwise, same as getRenderTargetHandle(). |
| 65 | * (In GL a separate FBO ID is used for the msaa and resolved buffers) |
| 66 | * @return the 3D API's handle to this object (e.g. FBO ID in OpenGL) |
| 67 | */ |
| 68 | virtual intptr_t getRenderTargetResolvedHandle() const = 0; |
| 69 | |
| 70 | /** |
bsalomon@google.com | f954d8d | 2011-04-06 17:50:02 +0000 | [diff] [blame] | 71 | * @return true if the render target is multisampled, false otherwise |
| 72 | */ |
| 73 | bool isMultisampled() { return fIsMultisampled; } |
| 74 | |
| 75 | /** |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 76 | * Call to indicate the multisample contents were modified such that the |
| 77 | * render target needs to be resolved before it can be used as texture. Gr |
| 78 | * tracks this for its own drawing and thus this only needs to be called |
| 79 | * when the render target has been modified outside of Gr. Only meaningful |
| 80 | * for Gr-created RT/Textures and Platform RT/Textures created with the |
| 81 | * kGrCanResolve flag. |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 82 | * @param rect a rect bounding the area needing resolve. NULL indicates |
| 83 | * the whole RT needs resolving. |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 84 | */ |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 85 | void flagAsNeedingResolve(const GrIRect* rect = NULL); |
| 86 | |
| 87 | /** |
| 88 | * Call to override the region that needs to be resolved. |
| 89 | */ |
| 90 | void overrideResolveRect(const GrIRect rect); |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 91 | |
| 92 | /** |
| 93 | * Call to indicate that GrRenderTarget was externally resolved. This may |
| 94 | * allow Gr to skip a redundant resolve step. |
| 95 | */ |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 96 | void flagAsResolved() { fResolveRect.setLargestInverted(); } |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 97 | |
| 98 | /** |
| 99 | * @return true if the GrRenderTarget requires MSAA resolving |
| 100 | */ |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 101 | bool needsResolve() const { return !fResolveRect.isEmpty(); } |
| 102 | |
| 103 | /** |
| 104 | * Returns a rect bounding the region needing resolving. |
| 105 | */ |
| 106 | const GrIRect& getResolveRect() const { return fResolveRect; } |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 107 | |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 108 | // GrResource overrides |
| 109 | virtual size_t sizeInBytes() const; |
| 110 | |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 111 | /** |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 112 | * Reads a rectangle of pixels from the render target. |
| 113 | * @param left left edge of the rectangle to read (inclusive) |
| 114 | * @param top top edge of the rectangle to read (inclusive) |
| 115 | * @param width width of rectangle to read in pixels. |
| 116 | * @param height height of rectangle to read in pixels. |
| 117 | * @param config the pixel config of the destination buffer |
| 118 | * @param buffer memory to read the rectangle into. |
| 119 | * |
| 120 | * @return true if the read succeeded, false if not. The read can fail |
| 121 | * because of a unsupported pixel config. |
| 122 | */ |
| 123 | bool readPixels(int left, int top, int width, int height, |
| 124 | GrPixelConfig config, void* buffer); |
| 125 | |
bsalomon@google.com | 5877ffd | 2011-04-11 17:58:48 +0000 | [diff] [blame] | 126 | // a MSAA RT may require explicit resolving , it may auto-resolve (e.g. FBO |
| 127 | // 0 in GL), or be unresolvable because the client didn't give us the |
| 128 | // resolve destination. |
| 129 | enum ResolveType { |
| 130 | kCanResolve_ResolveType, |
| 131 | kAutoResolves_ResolveType, |
| 132 | kCantResolve_ResolveType, |
| 133 | }; |
| 134 | virtual ResolveType getResolveType() const = 0; |
| 135 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 136 | protected: |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 137 | GrRenderTarget(GrGpu* gpu, |
| 138 | GrTexture* texture, |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 139 | int width, |
| 140 | int height, |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 141 | GrPixelConfig config, |
bsalomon@google.com | f954d8d | 2011-04-06 17:50:02 +0000 | [diff] [blame] | 142 | int stencilBits, |
| 143 | bool isMultisampled) |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 144 | : INHERITED(gpu) |
| 145 | , fTexture(texture) |
| 146 | , fWidth(width) |
| 147 | , fHeight(height) |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 148 | , fConfig(config) |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 149 | , fStencilBits(stencilBits) |
bsalomon@google.com | f954d8d | 2011-04-06 17:50:02 +0000 | [diff] [blame] | 150 | , fIsMultisampled(isMultisampled) |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 151 | { |
| 152 | fResolveRect.setLargestInverted(); |
| 153 | } |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 154 | |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 155 | friend class GrTexture; |
| 156 | // When a texture unrefs an owned rendertarget this func |
| 157 | // removes the back pointer. This could be done called from |
| 158 | // texture's destructor but would have to be done in derived |
| 159 | // class. By the time of texture base destructor it has already |
| 160 | // lost its pointer to the rt. |
| 161 | void onTextureReleaseRenderTarget() { |
| 162 | GrAssert(NULL != fTexture); |
| 163 | fTexture = NULL; |
| 164 | } |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 165 | |
bsalomon@google.com | 8295dc1 | 2011-05-02 12:53:34 +0000 | [diff] [blame] | 166 | private: |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 167 | GrTexture* fTexture; // not ref'ed |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 168 | int fWidth; |
| 169 | int fHeight; |
| 170 | GrPixelConfig fConfig; |
| 171 | int fStencilBits; |
| 172 | bool fIsMultisampled; |
| 173 | GrIRect fResolveRect; |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 174 | |
bsalomon@google.com | d302f14 | 2011-03-03 13:54:13 +0000 | [diff] [blame] | 175 | // GrGpu keeps a cached clip in the render target to avoid redundantly |
| 176 | // rendering the clip into the same stencil buffer. |
| 177 | friend class GrGpu; |
| 178 | GrClip fLastStencilClip; |
| 179 | |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 180 | typedef GrResource INHERITED; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 181 | }; |
| 182 | |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 183 | class GrTexture : public GrResource { |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 184 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 185 | public: |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 186 | /** |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 187 | * Retrieves the width of the texture. |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 188 | * |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 189 | * @return the width in texels |
| 190 | */ |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 191 | int width() const { return fWidth; } |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 192 | |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 193 | /** |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 194 | * Retrieves the height of the texture. |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 195 | * |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 196 | * @return the height in texels |
| 197 | */ |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 198 | int height() const { return fHeight; } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 199 | |
| 200 | /** |
| 201 | * Convert from texels to normalized texture coords for POT textures |
| 202 | * only. |
| 203 | */ |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 204 | GrFixed normalizeFixedX(GrFixed x) const { GrAssert(GrIsPow2(fWidth)); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 205 | return x >> fShiftFixedX; } |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 206 | GrFixed normalizeFixedY(GrFixed y) const { GrAssert(GrIsPow2(fHeight)); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 207 | return y >> fShiftFixedY; } |
| 208 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 209 | /** |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 210 | * Retrieves the pixel config specified when the texture was created. |
| 211 | */ |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 212 | GrPixelConfig config() const { return fConfig; } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 213 | |
| 214 | /** |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 215 | * Approximate number of bytes used by the texture |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 216 | */ |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 217 | virtual size_t sizeInBytes() const { |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 218 | return fWidth * fHeight * GrBytesPerPixel(fConfig); |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 219 | } |
| 220 | |
| 221 | /** |
| 222 | * Updates a subrectangle of texels in the texture. |
| 223 | * |
junov@google.com | 4ee7ae5 | 2011-06-30 17:30:49 +0000 | [diff] [blame] | 224 | * @param x left edge of rectangle to update |
| 225 | * @param y top edge of rectangle to update |
| 226 | * @param width width of rectangle to update |
| 227 | * @param height height of rectangle to update |
| 228 | * @param srcData width*height texels of data in same format that was |
| 229 | * used at texture creation. |
| 230 | * @param rowBytes number of bytes per row in srcData, 0 means rows are |
| 231 | * packed |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 232 | */ |
bsalomon@google.com | 79d2dbe | 2011-06-13 19:28:02 +0000 | [diff] [blame] | 233 | virtual void uploadTextureData(int x, |
| 234 | int y, |
| 235 | int width, |
| 236 | int height, |
junov@google.com | 4ee7ae5 | 2011-06-30 17:30:49 +0000 | [diff] [blame] | 237 | const void* srcData, |
| 238 | size_t rowBytes) = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 239 | |
| 240 | /** |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 241 | * Reads a rectangle of pixels from the texture. |
| 242 | * @param left left edge of the rectangle to read (inclusive) |
| 243 | * @param top top edge of the rectangle to read (inclusive) |
| 244 | * @param width width of rectangle to read in pixels. |
| 245 | * @param height height of rectangle to read in pixels. |
| 246 | * @param config the pixel config of the destination buffer |
| 247 | * @param buffer memory to read the rectangle into. |
| 248 | * |
| 249 | * @return true if the read succeeded, false if not. The read can fail |
| 250 | * because of a unsupported pixel config. |
| 251 | */ |
| 252 | bool readPixels(int left, int top, int width, int height, |
| 253 | GrPixelConfig config, void* buffer); |
| 254 | |
| 255 | /** |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 256 | * Retrieves the render target underlying this texture that can be passed to |
| 257 | * GrGpu::setRenderTarget(). |
| 258 | * |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 259 | * @return handle to render target or NULL if the texture is not a |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 260 | * render target |
| 261 | */ |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 262 | GrRenderTarget* asRenderTarget() { return fRenderTarget; } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 263 | |
| 264 | /** |
bsalomon@google.com | 1da0746 | 2011-03-10 14:51:57 +0000 | [diff] [blame] | 265 | * Removes the reference on the associated GrRenderTarget held by this |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 266 | * texture. Afterwards asRenderTarget() will return NULL. The |
bsalomon@google.com | 1da0746 | 2011-03-10 14:51:57 +0000 | [diff] [blame] | 267 | * GrRenderTarget survives the release if another ref is held on it. |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 268 | */ |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 269 | void releaseRenderTarget() { |
| 270 | if (NULL != fRenderTarget) { |
| 271 | GrAssert(fRenderTarget->asTexture() == this); |
| 272 | fRenderTarget->onTextureReleaseRenderTarget(); |
| 273 | fRenderTarget->unref(); |
| 274 | fRenderTarget = NULL; |
| 275 | } |
| 276 | } |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 277 | |
| 278 | /** |
| 279 | * Return the native ID or handle to the texture, depending on the |
| 280 | * platform. e.g. on opengl, return the texture ID. |
| 281 | */ |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 282 | virtual intptr_t getTextureHandle() const = 0; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 283 | |
| 284 | #if GR_DEBUG |
| 285 | void validate() const { |
| 286 | this->INHERITED::validate(); |
| 287 | } |
| 288 | #else |
| 289 | void validate() const {} |
| 290 | #endif |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 291 | |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 292 | protected: |
| 293 | GrRenderTarget* fRenderTarget; // texture refs its rt representation |
| 294 | // base class cons sets to NULL |
| 295 | // subclass cons can create and set |
| 296 | |
| 297 | GrTexture(GrGpu* gpu, |
| 298 | int width, |
| 299 | int height, |
| 300 | GrPixelConfig config) |
| 301 | : INHERITED(gpu) |
| 302 | , fRenderTarget(NULL) |
| 303 | , fWidth(width) |
| 304 | , fHeight(height) |
| 305 | , fConfig(config) { |
| 306 | // only make sense if alloc size is pow2 |
| 307 | fShiftFixedX = 31 - Gr_clz(fWidth); |
| 308 | fShiftFixedY = 31 - Gr_clz(fHeight); |
| 309 | } |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 310 | |
bsalomon@google.com | 6dcf499 | 2011-04-05 21:16:14 +0000 | [diff] [blame] | 311 | // GrResource overrides |
| 312 | virtual void onRelease() { |
| 313 | releaseRenderTarget(); |
| 314 | } |
| 315 | |
| 316 | virtual void onAbandon() { |
| 317 | if (NULL != fRenderTarget) { |
| 318 | fRenderTarget->abandon(); |
| 319 | } |
| 320 | } |
| 321 | |
bsalomon@google.com | 1c13c96 | 2011-02-14 16:51:21 +0000 | [diff] [blame] | 322 | private: |
bsalomon@google.com | c6cf723 | 2011-02-17 16:43:10 +0000 | [diff] [blame] | 323 | int fWidth; |
| 324 | int fHeight; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 325 | // these two shift a fixed-point value into normalized coordinates |
| 326 | // for this texture if the texture is power of two sized. |
| 327 | int fShiftFixedX; |
| 328 | int fShiftFixedY; |
bsalomon@google.com | 669fdc4 | 2011-04-05 17:08:27 +0000 | [diff] [blame] | 329 | |
| 330 | GrPixelConfig fConfig; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 331 | |
bsalomon@google.com | 8fe7247 | 2011-03-30 21:26:44 +0000 | [diff] [blame] | 332 | typedef GrResource INHERITED; |
reed@google.com | ac10a2d | 2010-12-22 21:39:39 +0000 | [diff] [blame] | 333 | }; |
| 334 | |
| 335 | #endif |
| 336 | |