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 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 | 1865 |
1866 fContext->getLayerCache()->trackPicture(picture); | 1866 fContext->getLayerCache()->trackPicture(picture); |
1867 } | 1867 } |
1868 | 1868 |
1869 static void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* re
sult) { | 1869 static void wrap_texture(GrTexture* texture, int width, int height, SkBitmap* re
sult) { |
1870 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); | 1870 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
1871 result->setInfo(info); | 1871 result->setInfo(info); |
1872 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); | 1872 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); |
1873 } | 1873 } |
1874 | 1874 |
1875 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* picture) { | 1875 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* mainCanvas, const SkPicture
* picture, |
| 1876 const SkMatrix* matrix, const SkPaint
* paint) { |
| 1877 // todo: should handle these natively |
| 1878 if (matrix || paint) { |
| 1879 return false; |
| 1880 } |
| 1881 |
1876 fContext->getLayerCache()->processDeletedPictures(); | 1882 fContext->getLayerCache()->processDeletedPictures(); |
1877 | 1883 |
1878 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); | 1884 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); |
1879 | 1885 |
1880 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); | 1886 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); |
1881 if (NULL == data) { | 1887 if (NULL == data) { |
1882 return false; | 1888 return false; |
1883 } | 1889 } |
1884 | 1890 |
1885 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); | 1891 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 } | 2130 } |
2125 | 2131 |
2126 return true; | 2132 return true; |
2127 } | 2133 } |
2128 | 2134 |
2129 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 2135 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
2130 // We always return a transient cache, so it is freed after each | 2136 // We always return a transient cache, so it is freed after each |
2131 // filter traversal. | 2137 // filter traversal. |
2132 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 2138 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
2133 } | 2139 } |
OLD | NEW |