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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 case kNVPR_DeviceType: { | 148 case kNVPR_DeviceType: { |
149 SkAutoTUnref<GrSurface> target; | 149 SkAutoTUnref<GrSurface> target; |
150 if (fGrContext) { | 150 if (fGrContext) { |
151 // create a render target to back the device | 151 // create a render target to back the device |
152 GrSurfaceDesc desc; | 152 GrSurfaceDesc desc; |
153 desc.fConfig = kSkia8888_GrPixelConfig; | 153 desc.fConfig = kSkia8888_GrPixelConfig; |
154 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 154 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
155 desc.fWidth = width; | 155 desc.fWidth = width; |
156 desc.fHeight = height; | 156 desc.fHeight = height; |
157 desc.fSampleCnt = fSampleCount; | 157 desc.fSampleCnt = fSampleCount; |
158 target.reset(fGrContext->createUncachedTexture(desc, NULL, 0)); | 158 target.reset(fGrContext->createTexture(desc, false, NULL, 0)); |
159 } | 159 } |
160 | 160 |
161 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; | 161 uint32_t flags = fUseDFText ? SkSurfaceProps::kUseDistanceFieldFonts
_Flag : 0; |
162 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); | 162 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType
); |
163 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende
rTarget(), &props)); | 163 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target->asRende
rTarget(), &props)); |
164 if (!device) { | 164 if (!device) { |
165 return NULL; | 165 return NULL; |
166 } | 166 } |
167 canvas = SkNEW_ARGS(SkCanvas, (device)); | 167 canvas = SkNEW_ARGS(SkCanvas, (device)); |
168 break; | 168 break; |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 case kNone_BBoxHierarchyType: | 825 case kNone_BBoxHierarchyType: |
826 return NULL; | 826 return NULL; |
827 case kRTree_BBoxHierarchyType: | 827 case kRTree_BBoxHierarchyType: |
828 return SkNEW(SkRTreeFactory); | 828 return SkNEW(SkRTreeFactory); |
829 } | 829 } |
830 SkASSERT(0); // invalid bbhType | 830 SkASSERT(0); // invalid bbhType |
831 return NULL; | 831 return NULL; |
832 } | 832 } |
833 | 833 |
834 } // namespace sk_tools | 834 } // namespace sk_tools |
OLD | NEW |