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

Unified Diff: include/gpu/GrContext.h

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Removing the concept of a dirty mipmap. It is expected that the texture upload provides the mipmaps. Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: include/gpu/GrContext.h
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 64f4f6ce30e6609b0d8ca3b1dd99cdde35739a86..a93c97cc8280b5f2e0030e25ce0a1bc2ba3776ac 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -16,7 +16,9 @@
#include "GrTextureProvider.h"
#include "SkMatrix.h"
#include "SkMutex.h"
+#include "SkMipMapLevel.h"
#include "SkPathEffect.h"
+#include "SkTArray.h"
#include "SkTypes.h"
struct GrBatchAtlasConfig;
@@ -257,15 +259,30 @@ public:
* @param width width of rectangle to write in pixels.
* @param height height of rectangle to write in pixels.
* @param config the pixel config of the source buffer
- * @param buffer memory to read pixels from
- * @param rowBytes number of bytes between consecutive rows. Zero
- * means rows are tightly packed.
+ * @param texels array of mipmap levels containing texel data to load.
+ * Begins with full-sized palette data for paletted textures.
+ * For compressed formats it contains the compressed pixel data.
+ * Otherwise, it contains width*height texels. If there is only one
+ * element and it contains nullptr fTexels, texture data is
+ * uninitialized.
* @param pixelOpsFlags see PixelOpsFlags enum above.
+ *
* @return true if the write succeeded, false if not. The write can fail because of an
* unsupported combination of surface and src configs.
*/
bool writeSurfacePixels(GrSurface* surface,
int left, int top, int width, int height,
+ GrPixelConfig config, const SkTArray<SkMipMapLevel>& texels,
+ uint32_t pixelOpsFlags = 0);
+
+ /**
+ * This function is a shim which creates a SkTArray<SkMipMapLevel> of size 1.
+ * It then calls writeSurfacePixels() with that SkTArray.
+ * This is so older code which currently uses this function signature will
+ * continue to work.
+ */
+ bool writeSurfacePixels(GrSurface* surface,
+ int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t rowBytes,
uint32_t pixelOpsFlags = 0);
« no previous file with comments | « include/core/SkPixelRef.h ('k') | include/gpu/GrSurface.h » ('j') | include/gpu/GrSurface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698