Index: src/image/SkSurface_Gpu.cpp |
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp |
index 58f9ef34375d54853940ed44cb781e463c5ac80c..d46d8bc74b0fe748432c8d7249e1f9c6a1ce8327 100644 |
--- a/src/image/SkSurface_Gpu.cpp |
+++ b/src/image/SkSurface_Gpu.cpp |
@@ -14,7 +14,6 @@ class SkSurface_Gpu : public SkSurface_Base { |
public: |
SK_DECLARE_INST_COUNT(SkSurface_Gpu) |
- SkSurface_Gpu(GrContext*, const SkImageInfo&, int sampleCount); |
SkSurface_Gpu(GrRenderTarget*); |
virtual ~SkSurface_Gpu(); |
@@ -33,18 +32,6 @@ private: |
/////////////////////////////////////////////////////////////////////////////// |
-SkSurface_Gpu::SkSurface_Gpu(GrContext* ctx, const SkImageInfo& info, |
- int sampleCount) |
- : INHERITED(info.fWidth, info.fHeight) { |
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info); |
- |
- fDevice = SkNEW_ARGS(SkGpuDevice, (ctx, config, info.fWidth, info.fHeight, sampleCount)); |
- |
- if (!SkAlphaTypeIsOpaque(info.fAlphaType)) { |
- fDevice->clear(0x0); |
- } |
-} |
- |
SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget) |
: INHERITED(renderTarget->width(), renderTarget->height()) { |
fDevice = SkNEW_ARGS(SkGpuDevice, (renderTarget->getContext(), renderTarget)); |
@@ -85,9 +72,10 @@ void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) { |
// are we sharing our render target with the image? |
SkASSERT(NULL != this->getCachedImage()); |
if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) { |
- SkAutoTUnref<SkGpuDevice> newDevice(SkNEW_ARGS(SkGpuDevice, |
- (fDevice->context(), fDevice->config(), fDevice->width(), |
- fDevice->height(), rt->numSamples()))); |
+ SkAutoTUnref<SkGpuDevice> newDevice(SkGpuDevice::Create(fDevice->context(), |
+ fDevice->imageInfo(), |
+ rt->numSamples())); |
+ SkASSERT(newDevice.get()); |
if (kRetain_ContentChangeMode == mode) { |
fDevice->context()->copyTexture(rt->asTexture(), |