| OLD | NEW |
| 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 "SkBlurMask.h" | 8 #include "SkBlurMask.h" |
| 9 #include "SkBlurMaskFilter.h" | 9 #include "SkBlurMaskFilter.h" |
| 10 #include "SkBlurDrawLooper.h" | 10 #include "SkBlurDrawLooper.h" |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 SkMaskFilter::BlurRec rec; | 552 SkMaskFilter::BlurRec rec; |
| 553 bool success = mf->asABlur(&rec); | 553 bool success = mf->asABlur(&rec); |
| 554 REPORTER_ASSERT(reporter, !success); | 554 REPORTER_ASSERT(reporter, !success); |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 | 559 |
| 560 #if SK_SUPPORT_GPU | 560 #if SK_SUPPORT_GPU |
| 561 | 561 |
| 562 // This exercises the problem discovered in crbug.com/570232. The return value f
rom | 562 // This exercises the problem discovered in crbug.com/570232. The return value f
rom |
| 563 // SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlur
Effect::Create | 563 // SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlur
Effect::Create |
| 564 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctx) { | 564 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctx) { |
| 565 | 565 |
| 566 SkImageInfo info = SkImageInfo::MakeN32Premul(128, 128); | 566 SkImageInfo info = SkImageInfo::MakeN32Premul(128, 128); |
| 567 auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info)); | 567 auto surface(SkSurface::MakeRenderTarget(ctx, SkBudgeted::kNo, info)); |
| 568 SkCanvas* canvas = surface->getCanvas(); | 568 SkCanvas* canvas = surface->getCanvas(); |
| 569 | 569 |
| 570 SkRect r = SkRect::MakeXYWH(10, 10, 100, 100); | 570 SkRect r = SkRect::MakeXYWH(10, 10, 100, 100); |
| 571 SkRRect rr = SkRRect::MakeRectXY(r, 10, 10); | 571 SkRRect rr = SkRRect::MakeRectXY(r, 10, 10); |
| 572 | 572 |
| 573 SkPaint p; | 573 SkPaint p; |
| 574 p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 0.01f))->unref
(); | 574 p.setMaskFilter(SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 0.01f))->unref
(); |
| 575 | 575 |
| 576 canvas->drawRRect(rr, p); | 576 canvas->drawRRect(rr, p); |
| 577 } | 577 } |
| 578 | 578 |
| 579 #endif | 579 #endif |
| 580 | 580 |
| 581 ////////////////////////////////////////////////////////////////////////////////
/////////// | 581 ////////////////////////////////////////////////////////////////////////////////
/////////// |
| OLD | NEW |