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" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 return NULL; | 139 return NULL; |
140 } | 140 } |
141 | 141 |
142 GrTextureDesc desc; | 142 GrTextureDesc desc; |
143 desc.fFlags = kRenderTarget_GrTextureFlagBit | kCheckAllocation_GrTextureFla
gBit; | 143 desc.fFlags = kRenderTarget_GrTextureFlagBit | kCheckAllocation_GrTextureFla
gBit; |
144 desc.fWidth = info.width(); | 144 desc.fWidth = info.width(); |
145 desc.fHeight = info.height(); | 145 desc.fHeight = info.height(); |
146 desc.fConfig = SkImageInfo2GrPixelConfig(info); | 146 desc.fConfig = SkImageInfo2GrPixelConfig(info); |
147 desc.fSampleCnt = sampleCount; | 147 desc.fSampleCnt = sampleCount; |
148 | 148 |
149 SkAutoTUnref<GrTexture> tex(ctx->lockAndRefScratchTexture(desc, GrContext::k
Exact_ScratchTexMatch)); | 149 SkAutoTUnref<GrTexture> tex(ctx->refScratchTexture(desc, GrContext::kExact_S
cratchTexMatch)); |
150 | 150 |
151 if (NULL == tex) { | 151 if (NULL == tex) { |
152 return NULL; | 152 return NULL; |
153 } | 153 } |
154 | 154 |
155 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); | 155 return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); |
156 } | 156 } |
OLD | NEW |