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 1869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 SkTDArray<GrCachedLayer*> atlased, nonAtlased; | 1880 SkTDArray<GrCachedLayer*> atlased, nonAtlased; |
1881 atlased.setReserve(gpuData->numSaveLayers()); | 1881 atlased.setReserve(gpuData->numSaveLayers()); |
1882 | 1882 |
1883 // Generate the layer and/or ensure it is locked | 1883 // Generate the layer and/or ensure it is locked |
1884 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { | 1884 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { |
1885 if (pullForward[i]) { | 1885 if (pullForward[i]) { |
1886 const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i); | 1886 const GrAccelData::SaveLayerInfo& info = gpuData->saveLayerInfo(i); |
1887 | 1887 |
1888 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(
picture->uniqueID(), | 1888 GrCachedLayer* layer = fContext->getLayerCache()->findLayerOrCreate(
picture->uniqueID(), |
1889
info.fSaveLayerOpID, | 1889
info.fSaveLayerOpID, |
1890
info.fRestoreOpID, | 1890
info.fRestoreOpID, |
| 1891
info.fOffset, |
1891
info.fOriginXform); | 1892
info.fOriginXform); |
1892 | 1893 |
1893 GrReplacements::ReplacementInfo* layerInfo = replacements.push(); | 1894 GrReplacements::ReplacementInfo* layerInfo = replacements.push(); |
1894 layerInfo->fStart = info.fSaveLayerOpID; | 1895 layerInfo->fStart = info.fSaveLayerOpID; |
1895 layerInfo->fStop = info.fRestoreOpID; | 1896 layerInfo->fStop = info.fRestoreOpID; |
1896 layerInfo->fPos = info.fOffset; | 1897 layerInfo->fPos = info.fOffset; |
1897 | 1898 |
1898 GrTextureDesc desc; | 1899 GrTextureDesc desc; |
1899 desc.fFlags = kRenderTarget_GrTextureFlagBit; | 1900 desc.fFlags = kRenderTarget_GrTextureFlagBit; |
1900 desc.fWidth = info.fSize.fWidth; | 1901 desc.fWidth = info.fSize.fWidth; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); | 1942 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); |
1942 | 1943 |
1943 return true; | 1944 return true; |
1944 } | 1945 } |
1945 | 1946 |
1946 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1947 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
1947 // 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 |
1948 // filter traversal. | 1949 // filter traversal. |
1949 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1950 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
1950 } | 1951 } |
OLD | NEW |