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 "SkMutex.h" | 18 #include "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 GrDrawContext; | 28 class GrDrawContext; |
27 class GrDrawTarget; | 29 class GrDrawTarget; |
28 class GrFragmentProcessor; | 30 class GrFragmentProcessor; |
29 class GrGpu; | 31 class GrGpu; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 uint32_t pixelOpsFlags = 0); | 252 uint32_t pixelOpsFlags = 0); |
251 | 253 |
252 /** | 254 /** |
253 * Writes a rectangle of pixels to a surface. | 255 * Writes a rectangle of pixels to a surface. |
254 * @param surface the surface to write to. | 256 * @param surface the surface to write to. |
255 * @param left left edge of the rectangle to write (inclusive) | 257 * @param left left edge of the rectangle to write (inclusive) |
256 * @param top top edge of the rectangle to write (inclusive) | 258 * @param top top edge of the rectangle to write (inclusive) |
257 * @param width width of rectangle to write in pixels. | 259 * @param width width of rectangle to write in pixels. |
258 * @param height height of rectangle to write in pixels. | 260 * @param height height of rectangle to write in pixels. |
259 * @param config the pixel config of the source buffer | 261 * @param config the pixel config of the source buffer |
260 * @param buffer memory to read pixels from | 262 * @param texels array of mipmap levels containing texel data to load
. |
261 * @param rowBytes number of bytes between consecutive rows. Zero | 263 * Begins with full-sized palette data for paletted tex
tures. |
262 * means rows are tightly packed. | 264 * For compressed formats it contains the compressed pi
xel data. |
| 265 * Otherwise, it contains width*height texels. If there
is only one |
| 266 * element and it contains nullptr fTexels, texture dat
a is |
| 267 * uninitialized. |
263 * @param pixelOpsFlags see PixelOpsFlags enum above. | 268 * @param pixelOpsFlags see PixelOpsFlags enum above. |
| 269 * |
264 * @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 |
265 * unsupported combination of surface and src configs. | 271 * unsupported combination of surface and src configs. |
266 */ | 272 */ |
267 bool writeSurfacePixels(GrSurface* surface, | 273 bool writeSurfacePixels(GrSurface* surface, |
268 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 * This is so older code which currently uses this function signature will |
| 282 * continue to work. |
| 283 */ |
| 284 bool writeSurfacePixels(GrSurface* surface, |
| 285 int left, int top, int width, int height, |
269 GrPixelConfig config, const void* buffer, | 286 GrPixelConfig config, const void* buffer, |
270 size_t rowBytes, | 287 size_t rowBytes, |
271 uint32_t pixelOpsFlags = 0); | 288 uint32_t pixelOpsFlags = 0); |
272 | 289 |
273 /** | 290 /** |
274 * Copies a rectangle of texels from src to dst. | 291 * Copies a rectangle of texels from src to dst. |
275 * bounds. | 292 * bounds. |
276 * @param dst the surface to copy to. | 293 * @param dst the surface to copy to. |
277 * @param src the surface to copy from. | 294 * @param src the surface to copy from. |
278 * @param srcRect the rectangle of the src that should be copied. | 295 * @param srcRect the rectangle of the src that should be copied. |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 /** | 496 /** |
480 * A callback similar to the above for use by the TextBlobCache | 497 * A callback similar to the above for use by the TextBlobCache |
481 * TODO move textblob draw calls below context so we can use the call above. | 498 * TODO move textblob draw calls below context so we can use the call above. |
482 */ | 499 */ |
483 static void TextBlobCacheOverBudgetCB(void* data); | 500 static void TextBlobCacheOverBudgetCB(void* data); |
484 | 501 |
485 typedef SkRefCnt INHERITED; | 502 typedef SkRefCnt INHERITED; |
486 }; | 503 }; |
487 | 504 |
488 #endif | 505 #endif |
OLD | NEW |