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_Gpu.h" | 8 #include "SkSurface_Gpu.h" |
9 | 9 |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 if (NULL == context) { | 106 if (NULL == context) { |
107 return NULL; | 107 return NULL; |
108 } | 108 } |
109 if (!SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { | 109 if (!SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag)) { |
110 return NULL; | 110 return NULL; |
111 } | 111 } |
112 SkAutoTUnref<GrSurface> surface(context->textureProvider()->wrapBackendTextu
re(desc)); | 112 SkAutoTUnref<GrSurface> surface(context->textureProvider()->wrapBackendTextu
re(desc)); |
113 if (!surface) { | 113 if (!surface) { |
114 return NULL; | 114 return NULL; |
115 } | 115 } |
116 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget
(), props, | 116 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget
(), props)); |
117 SkGpuDevice::kNeedClear
_Flag)); | |
118 if (!device) { | 117 if (!device) { |
119 return NULL; | 118 return NULL; |
120 } | 119 } |
121 return SkNEW_ARGS(SkSurface_Gpu, (device)); | 120 return SkNEW_ARGS(SkSurface_Gpu, (device)); |
122 } | 121 } |
123 | 122 |
124 #endif | 123 #endif |
OLD | NEW |