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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 case kNVPR_DeviceType: { | 149 case kNVPR_DeviceType: { |
150 SkAutoTUnref<GrSurface> target; | 150 SkAutoTUnref<GrSurface> target; |
151 if (fGrContext) { | 151 if (fGrContext) { |
152 // create a render target to back the device | 152 // create a render target to back the device |
153 GrSurfaceDesc desc; | 153 GrSurfaceDesc desc; |
154 desc.fConfig = kSkia8888_GrPixelConfig; | 154 desc.fConfig = kSkia8888_GrPixelConfig; |
155 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 155 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
156 desc.fWidth = width; | 156 desc.fWidth = width; |
157 desc.fHeight = height; | 157 desc.fHeight = height; |
158 desc.fSampleCnt = fSampleCount; | 158 desc.fSampleCnt = fSampleCount; |
159 target.reset(fGrContext->createTexture(desc, false, NULL, 0)); | 159 target.reset(fGrContext->textureProvider()->createTexture(desc,
false, NULL, 0)); |
160 } | 160 } |
161 | 161 |
162 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; | 162 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; |
163 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); | 163 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); |
164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende
rTarget(), &props)); | 164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende
rTarget(), &props)); |
165 if (!device) { | 165 if (!device) { |
166 return NULL; | 166 return NULL; |
167 } | 167 } |
168 canvas = SkNEW_ARGS(SkCanvas, (device)); | 168 canvas = SkNEW_ARGS(SkCanvas, (device)); |
169 break; | 169 break; |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 case kNone_BBoxHierarchyType: | 813 case kNone_BBoxHierarchyType: |
814 return NULL; | 814 return NULL; |
815 case kRTree_BBoxHierarchyType: | 815 case kRTree_BBoxHierarchyType: |
816 return SkNEW(SkRTreeFactory); | 816 return SkNEW(SkRTreeFactory); |
817 } | 817 } |
818 SkASSERT(0); // invalid bbhType | 818 SkASSERT(0); // invalid bbhType |
819 return NULL; | 819 return NULL; |
820 } | 820 } |
821 | 821 |
822 } // namespace sk_tools | 822 } // namespace sk_tools |
OLD | NEW |