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

Side by Side Diff: samplecode/SampleFilterFuzz.cpp

Issue 1758023003: Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/174410… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: manual rebase Created 4 years, 9 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 | « include/utils/SkNWayCanvas.h ('k') | src/core/SkAnnotation.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 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 #include "SampleCode.h" 7 #include "SampleCode.h"
8 #include "Sk1DPathEffect.h" 8 #include "Sk1DPathEffect.h"
9 #include "Sk2DPathEffect.h" 9 #include "Sk2DPathEffect.h"
10 #include "SkAlphaThresholdFilter.h" 10 #include "SkAlphaThresholdFilter.h"
11 #include "SkArcToPathEffect.h" 11 #include "SkArcToPathEffect.h"
12 #include "SkAnnotation.h"
13 #include "SkBlurImageFilter.h" 12 #include "SkBlurImageFilter.h"
14 #include "SkBlurMaskFilter.h" 13 #include "SkBlurMaskFilter.h"
15 #include "SkCanvas.h" 14 #include "SkCanvas.h"
16 #include "SkColorCubeFilter.h" 15 #include "SkColorCubeFilter.h"
17 #include "SkColorFilter.h" 16 #include "SkColorFilter.h"
18 #include "SkColorFilterImageFilter.h" 17 #include "SkColorFilterImageFilter.h"
19 #include "SkColorMatrixFilter.h" 18 #include "SkColorMatrixFilter.h"
20 #include "SkComposeImageFilter.h" 19 #include "SkComposeImageFilter.h"
21 #include "SkCornerPathEffect.h" 20 #include "SkCornerPathEffect.h"
22 #include "SkDashPathEffect.h" 21 #include "SkDashPathEffect.h"
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 SkLayerRasterizer::Builder rasterizerBuilder; 537 SkLayerRasterizer::Builder rasterizerBuilder;
539 SkPaint paintForRasterizer; 538 SkPaint paintForRasterizer;
540 if (R(2) == 1) { 539 if (R(2) == 1) {
541 paintForRasterizer = make_paint(); 540 paintForRasterizer = make_paint();
542 } 541 }
543 rasterizerBuilder.addLayer(paintForRasterizer); 542 rasterizerBuilder.addLayer(paintForRasterizer);
544 SkAutoTUnref<SkRasterizer> rasterizer(rasterizerBuilder.detachRasterizer()); 543 SkAutoTUnref<SkRasterizer> rasterizer(rasterizerBuilder.detachRasterizer());
545 paint.setRasterizer(rasterizer); 544 paint.setRasterizer(rasterizer);
546 paint.setImageFilter(make_image_filter()); 545 paint.setImageFilter(make_image_filter());
547 SkAutoDataUnref data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool ())); 546 SkAutoDataUnref data(make_3Dlut(nullptr, make_bool(), make_bool(), make_bool ()));
548 SkAutoTUnref<SkAnnotation> annotation(
549 SkAnnotation::Create(make_string().c_str(), data));
550 paint.setAnnotation(annotation);
551 paint.setTextAlign(make_paint_align()); 547 paint.setTextAlign(make_paint_align());
552 paint.setTextSize(make_scalar()); 548 paint.setTextSize(make_scalar());
553 paint.setTextScaleX(make_scalar()); 549 paint.setTextScaleX(make_scalar());
554 paint.setTextSkewX(make_scalar()); 550 paint.setTextSkewX(make_scalar());
555 paint.setTextEncoding(make_paint_text_encoding()); 551 paint.setTextEncoding(make_paint_text_encoding());
556 return paint; 552 return paint;
557 } 553 }
558 554
559 static SkImageFilter* make_image_filter(bool canBeNull) { 555 static SkImageFilter* make_image_filter(bool canBeNull) {
560 SkImageFilter* filter = 0; 556 SkImageFilter* filter = 0;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 817 }
822 818
823 private: 819 private:
824 typedef SkView INHERITED; 820 typedef SkView INHERITED;
825 }; 821 };
826 822
827 ////////////////////////////////////////////////////////////////////////////// 823 //////////////////////////////////////////////////////////////////////////////
828 824
829 static SkView* MyFactory() { return new ImageFilterFuzzView; } 825 static SkView* MyFactory() { return new ImageFilterFuzzView; }
830 static SkViewRegister reg(MyFactory); 826 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/utils/SkNWayCanvas.h ('k') | src/core/SkAnnotation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698