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

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

Issue 616023002: Allow previously-hoisted layers to be reused in the same draw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comments Created 6 years, 2 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
« src/gpu/GrPictureUtils.cpp ('K') | « src/gpu/GrPictureUtils.cpp ('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 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 return false; 1843 return false;
1844 } 1844 }
1845 1845
1846 fContext->getLayerCache()->processDeletedPictures(); 1846 fContext->getLayerCache()->processDeletedPictures();
1847 1847
1848 SkRect clipBounds; 1848 SkRect clipBounds;
1849 if (!mainCanvas->getClipBounds(&clipBounds)) { 1849 if (!mainCanvas->getClipBounds(&clipBounds)) {
1850 return true; 1850 return true;
1851 } 1851 }
1852 1852
1853 SkTDArray<GrLayerHoister::HoistedLayer> atlased, nonAtlased; 1853 SkTDArray<GrLayerHoister::HoistedLayer> atlased, nonAtlased, recycled;
1854 1854
1855 if (!GrLayerHoister::FindLayersToHoist(mainPicture, clipBounds, &atlased, &n onAtlased, 1855 if (!GrLayerHoister::FindLayersToHoist(mainPicture, clipBounds, &atlased, &n onAtlased,
1856 fContext->getLayerCache())) { 1856 &recycled, fContext->getLayerCache()) ) {
1857 return false; 1857 return false;
1858 } 1858 }
1859 1859
1860 GrReplacements replacements; 1860 GrReplacements replacements;
1861 1861
1862 GrLayerHoister::DrawLayers(atlased, nonAtlased, &replacements); 1862 GrLayerHoister::DrawLayers(atlased, nonAtlased, recycled, &replacements);
1863 1863
1864 // Render the entire picture using new layers 1864 // Render the entire picture using new layers
1865 const SkMatrix initialMatrix = mainCanvas->getTotalMatrix(); 1865 const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
1866 1866
1867 GrRecordReplaceDraw(mainPicture, mainCanvas, &replacements, initialMatrix, N ULL); 1867 GrRecordReplaceDraw(mainPicture, mainCanvas, &replacements, initialMatrix, N ULL);
1868 1868
1869 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased) ; 1869 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), atlased, nonAtlased, recycled);
1870 1870
1871 return true; 1871 return true;
1872 } 1872 }
1873 1873
1874 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1874 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1875 // We always return a transient cache, so it is freed after each 1875 // We always return a transient cache, so it is freed after each
1876 // filter traversal. 1876 // filter traversal.
1877 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1877 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1878 } 1878 }
OLDNEW
« src/gpu/GrPictureUtils.cpp ('K') | « src/gpu/GrPictureUtils.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698