Index: src/gpu/GrSurface.cpp |
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp |
index 3ac8bc2280ce7255aef93d979c6503abd7159b80..48e2636a18d3a7b2fe7f3c994f6a4c5fc0f4f229 100644 |
--- a/src/gpu/GrSurface.cpp |
+++ b/src/gpu/GrSurface.cpp |
@@ -8,11 +8,21 @@ |
#include "GrSurface.h" |
#include "SkBitmap.h" |
+#include "SkGr.h" |
#include "SkImageEncoder.h" |
#include <stdio.h> |
SK_DEFINE_INST_COUNT(GrSurface) |
+void GrSurface::asImageInfo(SkImageInfo* info) const { |
+ if (!GrPixelConfig2ColorType(this->config(), &info->fColorType)) { |
+ sk_throw(); |
+ } |
+ info->fWidth = this->width(); |
+ info->fHeight = this->height(); |
+ info->fAlphaType = kPremul_SkAlphaType; |
+} |
+ |
bool GrSurface::savePixels(const char* filename) { |
SkBitmap bm; |
bm.setConfig(SkBitmap::kARGB_8888_Config, this->width(), this->height()); |