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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 #endif | 113 #endif |
114 case kGPU_DeviceType: { | 114 case kGPU_DeviceType: { |
115 SkAutoTUnref<GrSurface> target; | 115 SkAutoTUnref<GrSurface> target; |
116 if (fGrContext) { | 116 if (fGrContext) { |
117 // create a render target to back the device | 117 // create a render target to back the device |
118 GrTextureDesc desc; | 118 GrTextureDesc desc; |
119 desc.fConfig = kSkia8888_GrPixelConfig; | 119 desc.fConfig = kSkia8888_GrPixelConfig; |
120 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 120 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
121 desc.fWidth = width; | 121 desc.fWidth = width; |
122 desc.fHeight = height; | 122 desc.fHeight = height; |
123 desc.fSampleCnt = 0; | 123 desc.fSampleCnt = fSampleCount; |
124 target.reset(fGrContext->createUncachedTexture(desc, NULL, 0)); | 124 target.reset(fGrContext->createUncachedTexture(desc, NULL, 0)); |
125 } | 125 } |
126 if (NULL == target.get()) { | 126 if (NULL == target.get()) { |
127 SkASSERT(0); | 127 SkASSERT(0); |
128 return NULL; | 128 return NULL; |
129 } | 129 } |
130 | 130 |
131 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target)); | 131 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(target)); |
132 canvas = SkNEW_ARGS(SkCanvas, (device.get())); | 132 canvas = SkNEW_ARGS(SkCanvas, (device.get())); |
133 break; | 133 break; |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 virtual SkString getConfigNameInternal() SK_OVERRIDE { | 842 virtual SkString getConfigNameInternal() SK_OVERRIDE { |
843 return SkString("picture_clone"); | 843 return SkString("picture_clone"); |
844 } | 844 } |
845 }; | 845 }; |
846 | 846 |
847 PictureRenderer* CreatePictureCloneRenderer() { | 847 PictureRenderer* CreatePictureCloneRenderer() { |
848 return SkNEW(PictureCloneRenderer); | 848 return SkNEW(PictureCloneRenderer); |
849 } | 849 } |
850 | 850 |
851 } // namespace sk_tools | 851 } // namespace sk_tools |
OLD | NEW |