| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkSurface_Base.h" | 8 #include "SkSurface_Base.h" |
| 9 #include "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| 11 #include "SkGpuDevice.h" | 11 #include "SkGpuDevice.h" |
| 12 | 12 |
| 13 #if SK_SUPPORT_GPU |
| 14 |
| 13 class SkSurface_Gpu : public SkSurface_Base { | 15 class SkSurface_Gpu : public SkSurface_Base { |
| 14 public: | 16 public: |
| 15 SK_DECLARE_INST_COUNT(SkSurface_Gpu) | 17 SK_DECLARE_INST_COUNT(SkSurface_Gpu) |
| 16 | 18 |
| 17 SkSurface_Gpu(GrRenderTarget*, const SkSurfaceProps*, bool doClear); | 19 SkSurface_Gpu(GrRenderTarget*, const SkSurfaceProps*, bool doClear); |
| 18 virtual ~SkSurface_Gpu(); | 20 virtual ~SkSurface_Gpu(); |
| 19 | 21 |
| 20 virtual SkCanvas* onNewCanvas() SK_OVERRIDE; | 22 virtual SkCanvas* onNewCanvas() SK_OVERRIDE; |
| 21 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; | 23 virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE; |
| 22 virtual SkImage* onNewImageSnapshot() SK_OVERRIDE; | 24 virtual SkImage* onNewImageSnapshot() SK_OVERRIDE; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 desc.fSampleCnt = sampleCount; | 149 desc.fSampleCnt = sampleCount; |
| 148 | 150 |
| 149 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S
cratchTexMatch)); | 151 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S
cratchTexMatch)); |
| 150 | 152 |
| 151 if (NULL == tex) { | 153 if (NULL == tex) { |
| 152 return NULL; | 154 return NULL; |
| 153 } | 155 } |
| 154 | 156 |
| 155 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); | 157 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); |
| 156 } | 158 } |
| 159 |
| 160 #endif |
| OLD | NEW |