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 "PictureRenderer.h" | 8 #include "PictureRenderer.h" |
9 #include "picture_utils.h" | 9 #include "picture_utils.h" |
10 #include "SamplePipeControllers.h" | 10 #include "SamplePipeControllers.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 desc.fConfig = kSkia8888_GrPixelConfig; | 152 desc.fConfig = kSkia8888_GrPixelConfig; |
153 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 153 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
154 desc.fWidth = width; | 154 desc.fWidth = width; |
155 desc.fHeight = height; | 155 desc.fHeight = height; |
156 desc.fSampleCnt = fSampleCount; | 156 desc.fSampleCnt = fSampleCount; |
157 target.reset(fGrContext->textureProvider()->createTexture(desc,
false, NULL, 0)); | 157 target.reset(fGrContext->textureProvider()->createTexture(desc,
false, NULL, 0)); |
158 } | 158 } |
159 | 159 |
160 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; | 160 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; |
161 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); | 161 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); |
162 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende
rTarget(), &props)); | 162 SkAutoTUnref<SkGpuDevice> device( |
| 163 SkGpuDevice::Create(target->asRenderTarget(), &props, |
| 164 SkGpuDevice::kUninit_InitContents)); |
163 if (!device) { | 165 if (!device) { |
164 return NULL; | 166 return NULL; |
165 } | 167 } |
166 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); | 168 canvas.reset(SkNEW_ARGS(SkCanvas, (device))); |
167 break; | 169 break; |
168 } | 170 } |
169 #endif | 171 #endif |
170 default: | 172 default: |
171 SkASSERT(0); | 173 SkASSERT(0); |
172 return NULL; | 174 return NULL; |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 case kNone_BBoxHierarchyType: | 821 case kNone_BBoxHierarchyType: |
820 return NULL; | 822 return NULL; |
821 case kRTree_BBoxHierarchyType: | 823 case kRTree_BBoxHierarchyType: |
822 return SkNEW(SkRTreeFactory); | 824 return SkNEW(SkRTreeFactory); |
823 } | 825 } |
824 SkASSERT(0); // invalid bbhType | 826 SkASSERT(0); // invalid bbhType |
825 return NULL; | 827 return NULL; |
826 } | 828 } |
827 | 829 |
828 } // namespace sk_tools | 830 } // namespace sk_tools |
OLD | NEW |