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

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

Issue 471473002: Optimize CSS box-shadow performance (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: store SkMask and SkCachedData in cache 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
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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 SkMaskFilter* filter, const SkRegion& clip, 585 SkMaskFilter* filter, const SkRegion& clip,
586 GrPaint* grp, SkPaint::Style style) { 586 GrPaint* grp, SkPaint::Style style) {
587 SkMask srcM, dstM; 587 SkMask srcM, dstM;
588 588
589 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &context->getMat rix(), &srcM, 589 if (!SkDraw::DrawToMask(devPath, &clip.getBounds(), filter, &context->getMat rix(), &srcM,
590 SkMask::kComputeBoundsAndRenderImage_CreateMode, sty le)) { 590 SkMask::kComputeBoundsAndRenderImage_CreateMode, sty le)) {
591 return false; 591 return false;
592 } 592 }
593 SkAutoMaskFreeImage autoSrc(srcM.fImage); 593 SkAutoMaskFreeImage autoSrc(srcM.fImage);
594 594
595 if (!filter->filterMask(&dstM, srcM, context->getMatrix(), NULL)) { 595 if (!filter->filterMask(&dstM, srcM, context->getMatrix(), NULL, NULL)) {
596 return false; 596 return false;
597 } 597 }
598 // this will free-up dstM when we're done (allocated in filterMask()) 598 // this will free-up dstM when we're done (allocated in filterMask())
599 SkAutoMaskFreeImage autoDst(dstM.fImage); 599 SkAutoMaskFreeImage autoDst(dstM.fImage);
600 600
601 if (clip.quickReject(dstM.fBounds)) { 601 if (clip.quickReject(dstM.fBounds)) {
602 return false; 602 return false;
603 } 603 }
604 604
605 // we now have a device-aligned 8bit mask in dstM, ready to be drawn using 605 // we now have a device-aligned 8bit mask in dstM, ready to be drawn using
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1858 GrLayerHoister::UnlockLayers(fContext, atlased, nonAtlased, recycled); 1858 GrLayerHoister::UnlockLayers(fContext, atlased, nonAtlased, recycled);
1859 1859
1860 return true; 1860 return true;
1861 } 1861 }
1862 1862
1863 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 1863 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
1864 // We always return a transient cache, so it is freed after each 1864 // We always return a transient cache, so it is freed after each
1865 // filter traversal. 1865 // filter traversal.
1866 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 1866 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
1867 } 1867 }
OLDNEW
« src/effects/SkBlurMaskFilter.cpp ('K') | « src/effects/SkTableMaskFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698