Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 384753004: Cleanup SkPicture* classes a bit (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1822 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 result->setInfo(info); 1833 result->setInfo(info);
1834 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref(); 1834 result->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, texture)))->unref();
1835 } 1835 }
1836 1836
1837 void SkGpuDevice::EXPERIMENTAL_purge(const SkPicture* picture) { 1837 void SkGpuDevice::EXPERIMENTAL_purge(const SkPicture* picture) {
1838 fContext->getLayerCache()->purge(picture); 1838 fContext->getLayerCache()->purge(picture);
1839 } 1839 }
1840 1840
1841 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pi cture) { 1841 bool SkGpuDevice::EXPERIMENTAL_drawPicture(SkCanvas* canvas, const SkPicture* pi cture) {
1842 1842
1843 if (NULL == picture->fData.get()) {
1844 return false;
1845 }
1846
1847 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey(); 1843 SkPicture::AccelData::Key key = GPUAccelData::ComputeAccelDataKey();
1848 1844
1849 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key); 1845 const SkPicture::AccelData* data = picture->EXPERIMENTAL_getAccelData(key);
1850 if (NULL == data) { 1846 if (NULL == data) {
1851 return false; 1847 return false;
1852 } 1848 }
1853 1849
1854 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data); 1850 const GPUAccelData *gpuData = static_cast<const GPUAccelData*>(data);
1855 1851
1856 if (0 == gpuData->numSaveLayers()) { 1852 if (0 == gpuData->numSaveLayers()) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
2035 playback.draw(canvas, NULL); 2031 playback.draw(canvas, NULL);
2036 2032
2037 // unlock the layers 2033 // unlock the layers
2038 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { 2034 for (int i = 0; i < gpuData->numSaveLayers(); ++i) {
2039 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i); 2035 GrCachedLayer* layer = fContext->getLayerCache()->findLayer(picture, i);
2040 fContext->getLayerCache()->unlock(layer); 2036 fContext->getLayerCache()->unlock(layer);
2041 } 2037 }
2042 2038
2043 return true; 2039 return true;
2044 } 2040 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698