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

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: Fixing incorrect rebase. 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 17751664196ce850022382e7d9b809744e953b7c..9f8b5c4ede30174a4a892ae9ac9a63d04c41e5ff 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;
@@ -258,15 +260,33 @@ 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
bsalomon 2015/09/30 18:01:29 Why one element and not just a 0 element array?
cblume 2015/10/08 09:27:56 Oh. That...is a much better idea. I'll go through
+ * 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.
+ *
+ * @param buffer Pointer to the pixel values (optional).
+ * @param rowBytes The number of bytes between rows of the texture. Zero
+ * implies tightly packed rows. For compressed pixel configs, this
+ * field is ignored.
+ */
+ 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/SkMipMapLevel.h ('k') | include/gpu/GrSurface.h » ('j') | src/gpu/GrContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698