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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // create a render target to back the device | 154 // create a render target to back the device |
155 GrSurfaceDesc desc; | 155 GrSurfaceDesc desc; |
156 desc.fConfig = kSkia8888_GrPixelConfig; | 156 desc.fConfig = kSkia8888_GrPixelConfig; |
157 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 157 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
158 desc.fWidth = width; | 158 desc.fWidth = width; |
159 desc.fHeight = height; | 159 desc.fHeight = height; |
160 desc.fSampleCnt = fSampleCount; | 160 desc.fSampleCnt = fSampleCount; |
161 target.reset(fGrContext->textureProvider()->createTexture(desc,
false, nullptr, 0)); | 161 target.reset(fGrContext->textureProvider()->createTexture(desc,
false, nullptr, 0)); |
162 } | 162 } |
163 | 163 |
164 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; | 164 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDeviceIndependentF
onts_Flag : 0; |
165 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); | 165 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); |
166 SkAutoTUnref<SkGpuDevice> device( | 166 SkAutoTUnref<SkGpuDevice> device( |
167 SkGpuDevice::Create(target->asRenderTarget(), &props, | 167 SkGpuDevice::Create(target->asRenderTarget(), &props, |
168 SkGpuDevice::kUninit_InitContents)); | 168 SkGpuDevice::kUninit_InitContents)); |
169 if (!device) { | 169 if (!device) { |
170 return nullptr; | 170 return nullptr; |
171 } | 171 } |
172 canvas.reset(new SkCanvas(device)); | 172 canvas.reset(new SkCanvas(device)); |
173 break; | 173 break; |
174 } | 174 } |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 case kNone_BBoxHierarchyType: | 825 case kNone_BBoxHierarchyType: |
826 return nullptr; | 826 return nullptr; |
827 case kRTree_BBoxHierarchyType: | 827 case kRTree_BBoxHierarchyType: |
828 return new SkRTreeFactory; | 828 return new SkRTreeFactory; |
829 } | 829 } |
830 SkASSERT(0); // invalid bbhType | 830 SkASSERT(0); // invalid bbhType |
831 return nullptr; | 831 return nullptr; |
832 } | 832 } |
833 | 833 |
834 } // namespace sk_tools | 834 } // namespace sk_tools |
OLD | NEW |