| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
| 9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
| 10 | 10 |
| 11 #include "GrClip.h" | 11 #include "GrClip.h" |
| 12 #include "GrColor.h" | 12 #include "GrColor.h" |
| 13 #include "GrPaint.h" | 13 #include "GrPaint.h" |
| 14 #include "GrPathRendererChain.h" | 14 #include "GrPathRendererChain.h" |
| 15 #include "GrRenderTarget.h" | 15 #include "GrRenderTarget.h" |
| 16 #include "GrTextureProvider.h" | 16 #include "GrTextureProvider.h" |
| 17 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
| 18 #include "../private/SkMutex.h" | 18 #include "../private/SkMutex.h" |
| 19 #include "SkMipMapLevel.h" |
| 19 #include "SkPathEffect.h" | 20 #include "SkPathEffect.h" |
| 21 #include "SkTArray.h" |
| 20 #include "SkTypes.h" | 22 #include "SkTypes.h" |
| 21 | 23 |
| 22 struct GrBatchAtlasConfig; | 24 struct GrBatchAtlasConfig; |
| 23 class GrBatchFontCache; | 25 class GrBatchFontCache; |
| 24 class GrCaps; | 26 class GrCaps; |
| 25 struct GrContextOptions; | 27 struct GrContextOptions; |
| 26 class GrDrawingManager; | 28 class GrDrawingManager; |
| 27 class GrDrawContext; | 29 class GrDrawContext; |
| 28 class GrDrawTarget; | 30 class GrDrawTarget; |
| 29 class GrFragmentProcessor; | 31 class GrFragmentProcessor; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 uint32_t pixelOpsFlags = 0); | 253 uint32_t pixelOpsFlags = 0); |
| 252 | 254 |
| 253 /** | 255 /** |
| 254 * Writes a rectangle of pixels to a surface. | 256 * Writes a rectangle of pixels to a surface. |
| 255 * @param surface the surface to write to. | 257 * @param surface the surface to write to. |
| 256 * @param left left edge of the rectangle to write (inclusive) | 258 * @param left left edge of the rectangle to write (inclusive) |
| 257 * @param top top edge of the rectangle to write (inclusive) | 259 * @param top top edge of the rectangle to write (inclusive) |
| 258 * @param width width of rectangle to write in pixels. | 260 * @param width width of rectangle to write in pixels. |
| 259 * @param height height of rectangle to write in pixels. | 261 * @param height height of rectangle to write in pixels. |
| 260 * @param config the pixel config of the source buffer | 262 * @param config the pixel config of the source buffer |
| 261 * @param buffer memory to read pixels from | 263 * @param texels array of mipmap levels containing texel data to load
. |
| 262 * @param rowBytes number of bytes between consecutive rows. Zero | 264 * Begins with full-sized palette data for paletted tex
tures. |
| 263 * means rows are tightly packed. | 265 * For compressed formats it contains the compressed pi
xel data. |
| 266 * Otherwise, it contains width*height texels. If the a
rray is empty, |
| 267 * texture data is uninitialized. |
| 264 * @param pixelOpsFlags see PixelOpsFlags enum above. | 268 * @param pixelOpsFlags see PixelOpsFlags enum above. |
| 269 * |
| 265 * @return true if the write succeeded, false if not. The write can fail bec
ause of an | 270 * @return true if the write succeeded, false if not. The write can fail bec
ause of an |
| 266 * unsupported combination of surface and src configs. | 271 * unsupported combination of surface and src configs. |
| 267 */ | 272 */ |
| 268 bool writeSurfacePixels(GrSurface* surface, | 273 bool writeSurfacePixels(GrSurface* surface, |
| 269 int left, int top, int width, int height, | 274 int left, int top, int width, int height, |
| 275 GrPixelConfig config, const SkTArray<SkMipMapLevel>&
texels, |
| 276 uint32_t pixelOpsFlags = 0); |
| 277 |
| 278 /** |
| 279 * This function is a shim which creates a SkTArray<SkMipMapLevel> of size 1
. |
| 280 * It then calls writeSurfacePixels with that SkTArray. |
| 281 * |
| 282 * @param buffer Pointer to the pixel values (optional). |
| 283 * @param rowBytes The number of bytes between rows of the texture. Zero |
| 284 * implies tightly packed rows. For compressed pixel config
s, this |
| 285 * field is ignored. |
| 286 */ |
| 287 bool writeSurfacePixels(GrSurface* surface, |
| 288 int left, int top, int width, int height, |
| 270 GrPixelConfig config, const void* buffer, | 289 GrPixelConfig config, const void* buffer, |
| 271 size_t rowBytes, | 290 size_t rowBytes, |
| 272 uint32_t pixelOpsFlags = 0); | 291 uint32_t pixelOpsFlags = 0); |
| 273 | 292 |
| 274 /** | 293 /** |
| 275 * Copies a rectangle of texels from src to dst. | 294 * Copies a rectangle of texels from src to dst. |
| 276 * bounds. | 295 * bounds. |
| 277 * @param dst the surface to copy to. | 296 * @param dst the surface to copy to. |
| 278 * @param src the surface to copy from. | 297 * @param src the surface to copy from. |
| 279 * @param srcRect the rectangle of the src that should be copied. | 298 * @param srcRect the rectangle of the src that should be copied. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 /** | 459 /** |
| 441 * A callback similar to the above for use by the TextBlobCache | 460 * A callback similar to the above for use by the TextBlobCache |
| 442 * TODO move textblob draw calls below context so we can use the call above. | 461 * TODO move textblob draw calls below context so we can use the call above. |
| 443 */ | 462 */ |
| 444 static void TextBlobCacheOverBudgetCB(void* data); | 463 static void TextBlobCacheOverBudgetCB(void* data); |
| 445 | 464 |
| 446 typedef SkRefCnt INHERITED; | 465 typedef SkRefCnt INHERITED; |
| 447 }; | 466 }; |
| 448 | 467 |
| 449 #endif | 468 #endif |
| OLD | NEW |