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

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

Issue 942853002: Fix layer hoisting bug in SkCanvas::drawPicture path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | 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 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after
1854 return false; 1854 return false;
1855 } 1855 }
1856 1856
1857 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey(); 1857 SkPicture::AccelData::Key key = SkLayerInfo::ComputeKey();
1858 1858
1859 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke y); 1859 const SkPicture::AccelData* data = mainPicture->EXPERIMENTAL_getAccelData(ke y);
1860 if (!data) { 1860 if (!data) {
1861 return false; 1861 return false;
1862 } 1862 }
1863 1863
1864 SkRect clipBounds; 1864 const SkLayerInfo *gpuData = static_cast<const SkLayerInfo*>(data);
1865 if (!mainCanvas->getClipBounds(&clipBounds)) { 1865 if (0 == gpuData->numBlocks()) {
1866 return true; 1866 return false;
1867 } 1867 }
1868 1868
1869 SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRec t());
1870
1871 const SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
1872
1873 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled; 1869 SkTDArray<GrHoistedLayer> atlasedNeedRendering, atlasedRecycled;
1874 1870
1871 SkIRect iBounds;
1872 if (!mainCanvas->getClipDeviceBounds(&iBounds)) {
1873 return false;
1874 }
1875
1876 SkRect clipBounds = SkRect::Make(iBounds);
1877
1878 SkMatrix initialMatrix = mainCanvas->getTotalMatrix();
1879
1875 GrLayerHoister::FindLayersToAtlas(fContext, mainPicture, 1880 GrLayerHoister::FindLayersToAtlas(fContext, mainPicture,
1876 initialMatrix, 1881 initialMatrix,
1877 clipBounds, 1882 clipBounds,
1878 &atlasedNeedRendering, &atlasedRecycled, 1883 &atlasedNeedRendering, &atlasedRecycled,
1879 fRenderTarget->numSamples()); 1884 fRenderTarget->numSamples());
1880 1885
1881 GrLayerHoister::DrawLayersToAtlas(fContext, atlasedNeedRendering); 1886 GrLayerHoister::DrawLayersToAtlas(fContext, atlasedNeedRendering);
1882 1887
1883 SkTDArray<GrHoistedLayer> needRendering, recycled; 1888 SkTDArray<GrHoistedLayer> needRendering, recycled;
1884 1889
1890 SkAutoCanvasMatrixPaint acmp(mainCanvas, matrix, paint, mainPicture->cullRec t());
1891
1885 GrLayerHoister::FindLayersToHoist(fContext, mainPicture, 1892 GrLayerHoister::FindLayersToHoist(fContext, mainPicture,
1886 initialMatrix, 1893 initialMatrix,
1887 clipBounds, 1894 clipBounds,
1888 &needRendering, &recycled, 1895 &needRendering, &recycled,
1889 fRenderTarget->numSamples()); 1896 fRenderTarget->numSamples());
1890 1897
1891 GrLayerHoister::DrawLayers(fContext, needRendering); 1898 GrLayerHoister::DrawLayers(fContext, needRendering);
1892 1899
1893 // Render the entire picture using new layers 1900 // Render the entire picture using new layers
1894 GrRecordReplaceDraw(mainPicture, mainCanvas, fContext->getLayerCache(), 1901 GrRecordReplaceDraw(mainPicture, mainCanvas, fContext->getLayerCache(),
(...skipping 10 matching lines...) Expand all
1905 #endif 1912 #endif
1906 } 1913 }
1907 1914
1908 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1915 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1909 // We always return a transient cache, so it is freed after each 1916 // We always return a transient cache, so it is freed after each
1910 // filter traversal. 1917 // filter traversal.
1911 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1918 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1912 } 1919 }
1913 1920
1914 #endif 1921 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698