OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkGpuDevice.h" | 8 #include "SkGpuDevice.h" |
9 | 9 |
10 #include "effects/GrBicubicEffect.h" | 10 #include "effects/GrBicubicEffect.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 fNeedClear = flags & kNeedClear_Flag; | 150 fNeedClear = flags & kNeedClear_Flag; |
151 | 151 |
152 fRenderTarget = SkRef(surface->asRenderTarget()); | 152 fRenderTarget = SkRef(surface->asRenderTarget()); |
153 | 153 |
154 SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, | 154 SkPixelRef* pr = SkNEW_ARGS(SkGrPixelRef, |
155 (surface->info(), surface, SkToBool(flags & kCac
hed_Flag))); | 155 (surface->info(), surface, SkToBool(flags & kCac
hed_Flag))); |
156 fLegacyBitmap.setInfo(surface->info()); | 156 fLegacyBitmap.setInfo(surface->info()); |
157 fLegacyBitmap.setPixelRef(pr)->unref(); | 157 fLegacyBitmap.setPixelRef(pr)->unref(); |
158 | 158 |
159 bool useDFFonts = !!(flags & kDFFonts_Flag); | 159 bool useDFFonts = !!(flags & kDFFonts_Flag); |
160 fMainTextContext = fContext->createTextContext(fRenderTarget, fLeakyProperti
es, useDFFonts); | 160 fMainTextContext = fContext->createTextContext(fRenderTarget, this->getLeaky
Properties(), useDFFonts); |
161 fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, fLeakyProp
erties)); | 161 fFallbackTextContext = SkNEW_ARGS(GrBitmapTextContext, (fContext, this->getL
eakyProperties())); |
162 } | 162 } |
163 | 163 |
164 SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
, | 164 SkGpuDevice* SkGpuDevice::Create(GrContext* context, const SkImageInfo& origInfo
, |
165 int sampleCount) { | 165 int sampleCount) { |
166 if (kUnknown_SkColorType == origInfo.colorType() || | 166 if (kUnknown_SkColorType == origInfo.colorType() || |
167 origInfo.width() < 0 || origInfo.height() < 0) { | 167 origInfo.width() < 0 || origInfo.height() < 0) { |
168 return NULL; | 168 return NULL; |
169 } | 169 } |
170 | 170 |
171 SkColorType ct = origInfo.colorType(); | 171 SkColorType ct = origInfo.colorType(); |
(...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); | 1942 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); |
1943 | 1943 |
1944 return true; | 1944 return true; |
1945 } | 1945 } |
1946 | 1946 |
1947 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1947 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1948 // We always return a transient cache, so it is freed after each | 1948 // We always return a transient cache, so it is freed after each |
1949 // filter traversal. | 1949 // filter traversal. |
1950 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1950 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1951 } | 1951 } |
OLD | NEW |