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

Unified Diff: include/gpu/GrSurface.h

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fixing merge mistakes Created 5 years, 2 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/GrSurface.h
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 28935009ce8caee78187405c3b50616d7d2e9aed..8cde65ae2ea4a854222d52735d8fb36940afe55a 100644
--- a/include/gpu/GrSurface.h
+++ b/include/gpu/GrSurface.h
@@ -12,7 +12,9 @@
#include "GrTypes.h"
#include "GrGpuResource.h"
#include "SkImageInfo.h"
+#include "SkMipMapLevel.h"
#include "SkRect.h"
+#include "SkTArray.h"
class GrRenderTarget;
class GrSurfacePriv;
@@ -95,19 +97,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 the rectangle 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-size palette data for paletted textures.
+ * For compressed formats it contains the compressed pixel data.
+ * Otherwise, it contains width*height texels. If the array is empty,
+ * texture data is uninitialized.
* @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
*
- * @return true if the read succeeded, false if not. The read can fail because of an unsupported
- * pixel config.
+ * @return true if the read succeeded, false if not. The read can fail because of an
+ * unsupported pixel config.
+ */
+ bool writePixels(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 writePixels 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 writePixels(int left, int top, int width, int height,
- GrPixelConfig config,
- const void* buffer,
- size_t rowBytes = 0,
- uint32_t pixelOpsFlags = 0);
+ bool writePixels(int left, int top, int width, int height, GrPixelConfig config,
+ const void* buffer, size_t rowBytes = 0, uint32_t pixelOpsFlags = 0);
/**
* After this returns any pending writes to the surface will be issued to the backend 3D API.
« include/gpu/GrContext.h ('K') | « include/gpu/GrContext.h ('k') | include/gpu/GrTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698