diff options
author | 2013-12-13 15:24:37 +0000 | |
---|---|---|
committer | 2013-12-13 15:24:37 +0000 | |
commit | 0daa1adb03b4b1fc11d854cb7754416ac05a31e8 (patch) | |
tree | 65250ae1cb608dbebfa25e96c3c31335379ccd3a /src/gpu/SkGpuDevice.cpp | |
parent | 3c5f29a8a5f8113a831f132f1bb3d839d9fb285a (diff) |
Reverting r12665 & r12666 (Remove duplicate impl for SkImageInfo flattening) due to Chromium/Blink compilation errors
https://codereview.chromium.org/112603003/
git-svn-id: http://skia.googlecode.com/svn/trunk@12667 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index a413d04204..ce02f2c55f 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -214,10 +214,7 @@ void SkGpuDevice::initFromRenderTarget(GrContext* context, if (NULL == surface) { surface = fRenderTarget; } - - SkImageInfo info; - surface->asImageInfo(&info); - SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (info, surface, cached)); + SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (surface, cached)); this->setPixelRef(pr, 0)->unref(); } @@ -227,8 +224,8 @@ SkGpuDevice::SkGpuDevice(GrContext* context, int width, int height, int sampleCount) - : SkBitmapDevice(make_bitmap(config, width, height, false /*isOpaque*/)) -{ + : SkBitmapDevice(make_bitmap(config, width, height, false /*isOpaque*/)) { + fDrawProcs = NULL; fContext = context; @@ -248,14 +245,6 @@ SkGpuDevice::SkGpuDevice(GrContext* context, desc.fConfig = SkBitmapConfig2GrPixelConfig(config); desc.fSampleCnt = sampleCount; - SkImageInfo info; - if (!GrPixelConfig2ColorType(desc.fConfig, &info.fColorType)) { - sk_throw(); - } - info.fWidth = width; - info.fHeight = height; - info.fAlphaType = kPremul_SkAlphaType; - SkAutoTUnref<GrTexture> texture(fContext->createUncachedTexture(desc, NULL, 0)); if (NULL != texture) { @@ -265,7 +254,7 @@ SkGpuDevice::SkGpuDevice(GrContext* context, SkASSERT(NULL != fRenderTarget); // wrap the bitmap with a pixelref to expose our texture - SkGrPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (info, texture)); + SkGrPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, (texture)); this->setPixelRef(pr, 0)->unref(); } else { GrPrintf("--- failed to create gpu-offscreen [%d %d]\n", @@ -851,12 +840,11 @@ bool create_mask_GPU(GrContext* context, } SkBitmap wrap_texture(GrTexture* texture) { - SkImageInfo info; - texture->asImageInfo(&info); - SkBitmap result; - result.setConfig(info); - result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); + bool dummy; + SkBitmap::Config config = grConfig2skConfig(texture->config(), &dummy); + result.setConfig(config, texture->width(), texture->height()); + result.setPixelRef(SkNEW_ARGS(SkGrPixelRef, (texture)))->unref(); return result; } |