aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 21:15:58 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 21:15:58 +0000
commita0d183d89160e31962e99475abe8a77c30626a40 (patch)
treec557c0b40852c2c924c517a4d09f2a8a885cda08 /src/gpu
parentff9c6c92e5f962b34f7421e67ac112f81a018bd3 (diff)
This reverts commit 947e6a3142af66b750f1247ef933b11ed8455dd4. BUG= Review URL: https://codereview.chromium.org/112963003 git-svn-id: http://skia.googlecode.com/svn/trunk@12630 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrSurface.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index fed95f232f..1fcc4ff18b 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -8,9 +8,19 @@
#include "GrSurface.h"
#include "SkBitmap.h"
+#include "SkGr.h"
#include "SkImageEncoder.h"
#include <stdio.h>
+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());