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

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

Issue 471473002: Optimize CSS box-shadow performance (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: backed blur mask with a bitmap Created 6 years, 3 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
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkMaskCache.h"
9 #include "SkBitmapCache.h"
10
11 bool SkMaskCache::Find(SkScalar sigma, const SkRRect& rrect, SkMask* result) {
12 if (SkBitmapCache::Find(sigma, rrect, &result->fBitmap)) {
13 result->fBounds.set(0, 0, result->fBitmap.width(), result->fBitmap.heigh t());
14 result->fRowBytes = result->fBounds.width();
15 result->fFormat = SkMask::kA8_Format;
16 result->fImage = result->fBitmap.getAddr8(0, 0);
17 return true;
18 }
19 return false;
20 }
21
22 void SkMaskCache::Add(SkScalar sigma, const SkRRect& rrect, const SkMask& mask) {
23 SkBitmapCache::Add(sigma, rrect, mask.fBitmap);
24 }
25
26 //////////////////////////////////////////////////////////////////////////////// //////////
27
28 bool SkMaskCache::Find(SkScalar sigma, int32_t count, const SkRect rects[], SkMa sk* result) {
29 if (SkBitmapCache::Find(sigma, count, rects, &result->fBitmap)) {
30 result->fBounds.set(0, 0, result->fBitmap.width(), result->fBitmap.heigh t());
31 result->fRowBytes = result->fBounds.width();
32 result->fFormat = SkMask::kA8_Format;
33 result->fImage = result->fBitmap.getAddr8(0, 0);
34 return true;
35 }
36 return false;
37 }
38
39 void SkMaskCache::Add(SkScalar sigma, int32_t count, const SkRect rects[], const SkMask& mask) {
40 SkBitmapCache::Add(sigma, count, rects, mask.fBitmap);
41 }
42
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698