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/SkBlurMaskFilter.cpp

Issue 1855733002: change flattenable factory to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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/SkBlurImageFilter.cpp ('k') | src/effects/SkColorCubeFilter.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkBlurMaskFilter.h" 8 #include "SkBlurMaskFilter.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkGpuBlurUtils.h" 10 #include "SkGpuBlurUtils.h"
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 574 }
575 575
576 void SkBlurMaskFilterImpl::computeFastBounds(const SkRect& src, 576 void SkBlurMaskFilterImpl::computeFastBounds(const SkRect& src,
577 SkRect* dst) const { 577 SkRect* dst) const {
578 SkScalar pad = 3.0f * fSigma; 578 SkScalar pad = 3.0f * fSigma;
579 579
580 dst->set(src.fLeft - pad, src.fTop - pad, 580 dst->set(src.fLeft - pad, src.fTop - pad,
581 src.fRight + pad, src.fBottom + pad); 581 src.fRight + pad, src.fBottom + pad);
582 } 582 }
583 583
584 SkFlattenable* SkBlurMaskFilterImpl::CreateProc(SkReadBuffer& buffer) { 584 sk_sp<SkFlattenable> SkBlurMaskFilterImpl::CreateProc(SkReadBuffer& buffer) {
585 const SkScalar sigma = buffer.readScalar(); 585 const SkScalar sigma = buffer.readScalar();
586 const unsigned style = buffer.readUInt(); 586 const unsigned style = buffer.readUInt();
587 const unsigned flags = buffer.readUInt(); 587 const unsigned flags = buffer.readUInt();
588 if (style <= kLastEnum_SkBlurStyle) { 588 if (style <= kLastEnum_SkBlurStyle) {
589 return SkBlurMaskFilter::Create((SkBlurStyle)style, sigma, flags); 589 return sk_sp<SkFlattenable>(SkBlurMaskFilter::Create((SkBlurStyle)style, sigma, flags));
590 } 590 }
591 return nullptr; 591 return nullptr;
592 } 592 }
593 593
594 void SkBlurMaskFilterImpl::flatten(SkWriteBuffer& buffer) const { 594 void SkBlurMaskFilterImpl::flatten(SkWriteBuffer& buffer) const {
595 buffer.writeScalar(fSigma); 595 buffer.writeScalar(fSigma);
596 buffer.writeUInt(fBlurStyle); 596 buffer.writeUInt(fBlurStyle);
597 buffer.writeUInt(fBlurFlags); 597 buffer.writeUInt(fBlurFlags);
598 } 598 }
599 599
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 } else { 1308 } else {
1309 str->append("None"); 1309 str->append("None");
1310 } 1310 }
1311 str->append("))"); 1311 str->append("))");
1312 } 1312 }
1313 #endif 1313 #endif
1314 1314
1315 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1315 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1316 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1316 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1317 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1317 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkColorCubeFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698