Make all pixel ops go thru ctx so we can correctly flush. Unify two texture upload code paths.
Review URL: http://codereview.appspot.com/5373108/
git-svn-id: http://skia.googlecode.com/svn/trunk@2701 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index 1e6b420..764ccd3 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -253,6 +253,17 @@
config, buffer, rowBytes, invertY);
}
+void GrGpu::writeTexturePixels(GrTexture* texture,
+ int left, int top, int width, int height,
+ GrPixelConfig config, const void* buffer,
+ size_t rowBytes) {
+ GrAssert(GrPixelConfigIsUnpremultiplied(config) ==
+ GrPixelConfigIsUnpremultiplied(texture->config()));
+ this->handleDirtyContext();
+ this->onWriteTexturePixels(texture, left, top, width, height,
+ config, buffer, rowBytes);
+}
+
////////////////////////////////////////////////////////////////////////////////
static const int MAX_QUADS = 1 << 12; // max possible: (1 << 14) - 1;