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

Side by Side Diff: src/effects/SkBlurMask.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 (already done 255-x). 675 (already done 255-x).
676 676
677 It's the responsibility of the caller to delete the 677 It's the responsibility of the caller to delete the
678 memory returned in profile_out. 678 memory returned in profile_out.
679 */ 679 */
680 680
681 void SkBlurMask::ComputeBlurProfile(SkScalar sigma, uint8_t **profile_out) { 681 void SkBlurMask::ComputeBlurProfile(SkScalar sigma, uint8_t **profile_out) {
682 int size = SkScalarCeilToInt(6*sigma); 682 int size = SkScalarCeilToInt(6*sigma);
683 683
684 int center = size >> 1; 684 int center = size >> 1;
685 uint8_t *profile = SkNEW_ARRAY(uint8_t, size); 685 uint8_t* profile = new uint8_t[size];
686 686
687 float invr = 1.f/(2*sigma); 687 float invr = 1.f/(2*sigma);
688 688
689 profile[0] = 255; 689 profile[0] = 255;
690 for (int x = 1 ; x < size ; ++x) { 690 for (int x = 1 ; x < size ; ++x) {
691 float scaled_x = (center - x - .5f) * invr; 691 float scaled_x = (center - x - .5f) * invr;
692 float gi = gaussianIntegral(scaled_x); 692 float gi = gaussianIntegral(scaled_x);
693 profile[x] = 255 - (uint8_t) (255.f * gi); 693 profile[x] = 255 - (uint8_t) (255.f * gi);
694 } 694 }
695 695
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 (void)autoCall.detach(); 987 (void)autoCall.detach();
988 } 988 }
989 989
990 if (style == kInner_SkBlurStyle) { 990 if (style == kInner_SkBlurStyle) {
991 dst->fBounds = src.fBounds; // restore trimmed bounds 991 dst->fBounds = src.fBounds; // restore trimmed bounds
992 dst->fRowBytes = src.fRowBytes; 992 dst->fRowBytes = src.fRowBytes;
993 } 993 }
994 994
995 return true; 995 return true;
996 } 996 }
OLDNEW
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698