Chromium Code Reviews| 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 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1864 return false; | 1864 return false; |
| 1865 } | 1865 } |
| 1866 | 1866 |
| 1867 SkAutoTArray<bool> pullForward(gpuData->numSaveLayers()); | 1867 SkAutoTArray<bool> pullForward(gpuData->numSaveLayers()); |
| 1868 | 1868 |
| 1869 SkRect clipBounds; | 1869 SkRect clipBounds; |
| 1870 if (!mainCanvas->getClipBounds(&clipBounds)) { | 1870 if (!mainCanvas->getClipBounds(&clipBounds)) { |
| 1871 return true; | 1871 return true; |
| 1872 } | 1872 } |
| 1873 | 1873 |
| 1874 SkAutoTDelete<const SkPicture::OperationList> ops( | 1874 if (!GrLayerHoister::FindLayersToHoist(gpuData, clipBounds, pullForward.get( ))) { |
| 1875 picture->EXPERIMENTAL_getActiveOps(clipBounds)); | |
| 1876 | |
| 1877 if (!GrLayerHoister::FindLayersToHoist(gpuData, ops.get(), clipBounds, pullF orward.get())) { | |
| 1878 return false; | 1875 return false; |
| 1879 } | 1876 } |
| 1880 | 1877 |
| 1881 SkPictureReplacementPlayback::PlaybackReplacements replacements; | 1878 SkPictureReplacementPlayback::PlaybackReplacements replacements; |
| 1882 | 1879 |
| 1883 SkTDArray<GrCachedLayer*> atlased, nonAtlased; | 1880 SkTDArray<GrCachedLayer*> atlased, nonAtlased; |
| 1884 atlased.setReserve(gpuData->numSaveLayers()); | 1881 atlased.setReserve(gpuData->numSaveLayers()); |
| 1885 | 1882 |
| 1886 // Generate the layer and/or ensure it is locked | 1883 // Generate the layer and/or ensure it is locked |
| 1887 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { | 1884 for (int i = 0; i < gpuData->numSaveLayers(); ++i) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1931 *atlased.append() = layer; | 1928 *atlased.append() = layer; |
| 1932 } else { | 1929 } else { |
| 1933 *nonAtlased.append() = layer; | 1930 *nonAtlased.append() = layer; |
| 1934 } | 1931 } |
| 1935 } | 1932 } |
| 1936 } | 1933 } |
| 1937 } | 1934 } |
| 1938 | 1935 |
| 1939 GrLayerHoister::DrawLayers(picture, atlased, nonAtlased); | 1936 GrLayerHoister::DrawLayers(picture, atlased, nonAtlased); |
| 1940 | 1937 |
| 1941 // Render the entire picture using new layers | 1938 // Render the entire picture using new layers |
|
robertphillips
2014/09/03 20:22:05
This call is going away in the next CL.
| |
| 1942 SkPictureReplacementPlayback playback(picture, &replacements, ops.get()); | 1939 SkPictureReplacementPlayback playback(picture, &replacements, NULL); |
| 1943 | 1940 |
| 1944 playback.draw(mainCanvas, NULL); | 1941 playback.draw(mainCanvas, NULL); |
| 1945 | 1942 |
| 1946 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); | 1943 GrLayerHoister::UnlockLayers(fContext->getLayerCache(), picture); |
| 1947 | 1944 |
| 1948 return true; | 1945 return true; |
| 1949 } | 1946 } |
| 1950 | 1947 |
| 1951 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { | 1948 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { |
| 1952 // We always return a transient cache, so it is freed after each | 1949 // We always return a transient cache, so it is freed after each |
| 1953 // filter traversal. | 1950 // filter traversal. |
| 1954 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); | 1951 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); |
| 1955 } | 1952 } |
| OLD | NEW |