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

Side by Side Diff: src/core/SkScaledImageCache.cpp

Issue 286273002: Optimize CSS box-shadow performance by caching the SkMask of the blur effect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase with latest skia in git instead of svn trunk Created 6 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkScaledImageCache.h" 8 #include "SkScaledImageCache.h"
9 #include "SkMipMap.h" 9 #include "SkMipMap.h"
10 #include "SkPixelRef.h" 10 #include "SkPixelRef.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 if (0 == size) { 269 if (0 == size) {
270 return false; 270 return false;
271 } 271 }
272 272
273 SkDiscardableMemory* dm = fFactory(size); 273 SkDiscardableMemory* dm = fFactory(size);
274 if (NULL == dm) { 274 if (NULL == dm) {
275 return false; 275 return false;
276 } 276 }
277 277
278 // can we relax this? 278 // can we relax this?
279 if (kN32_SkColorType != bitmap->colorType()) { 279 if (kN32_SkColorType != bitmap->colorType()
280 && kAlpha_8_SkColorType != bitmap->colorType()) {
280 return false; 281 return false;
281 } 282 }
282 283
283 SkImageInfo info = bitmap->info(); 284 SkImageInfo info = bitmap->info();
284 bitmap->setPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef, 285 bitmap->setPixelRef(SkNEW_ARGS(SkOneShotDiscardablePixelRef,
285 (info, dm, bitmap->rowBytes())))->unref(); 286 (info, dm, bitmap->rowBytes())))->unref();
286 bitmap->lockPixels(); 287 bitmap->lockPixels();
287 return bitmap->readyToDraw(); 288 return bitmap->readyToDraw();
288 } 289 }
289 290
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 return SkScaledImageCache::GetBytesUsed(); 775 return SkScaledImageCache::GetBytesUsed();
775 } 776 }
776 777
777 size_t SkGraphics::GetImageCacheByteLimit() { 778 size_t SkGraphics::GetImageCacheByteLimit() {
778 return SkScaledImageCache::GetByteLimit(); 779 return SkScaledImageCache::GetByteLimit();
779 } 780 }
780 781
781 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) { 782 size_t SkGraphics::SetImageCacheByteLimit(size_t newLimit) {
782 return SkScaledImageCache::SetByteLimit(newLimit); 783 return SkScaledImageCache::SetByteLimit(newLimit);
783 } 784 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698