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

Side by Side Diff: tests/AAClipTest.cpp

Issue 300263005: Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/3044430… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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/utils/SkCanvasStateUtils.cpp ('k') | tests/BitmapGetColorTest.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 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 "SkAAClip.h" 8 #include "SkAAClip.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkMask.h" 10 #include "SkMask.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 mask->fBounds = rgn.getBounds(); 69 mask->fBounds = rgn.getBounds();
70 mask->fRowBytes = mask->fBounds.width(); 70 mask->fRowBytes = mask->fBounds.width();
71 mask->fImage = SkMask::AllocImage(mask->computeImageSize()); 71 mask->fImage = SkMask::AllocImage(mask->computeImageSize());
72 sk_bzero(mask->fImage, mask->computeImageSize()); 72 sk_bzero(mask->fImage, mask->computeImageSize());
73 73
74 SkImageInfo info = SkImageInfo::Make(mask->fBounds.width(), 74 SkImageInfo info = SkImageInfo::Make(mask->fBounds.width(),
75 mask->fBounds.height(), 75 mask->fBounds.height(),
76 kAlpha_8_SkColorType, 76 kAlpha_8_SkColorType,
77 kPremul_SkAlphaType); 77 kPremul_SkAlphaType);
78 SkBitmap bitmap; 78 SkBitmap bitmap;
79 bitmap.installPixels(info, mask->fImage, mask->fRowBytes, NULL, NULL); 79 bitmap.installPixels(info, mask->fImage, mask->fRowBytes);
80 80
81 // canvas expects its coordinate system to always be 0,0 in the top/left 81 // canvas expects its coordinate system to always be 0,0 in the top/left
82 // so we translate the rgn to match that before drawing into the mask. 82 // so we translate the rgn to match that before drawing into the mask.
83 // 83 //
84 SkRegion tmpRgn(rgn); 84 SkRegion tmpRgn(rgn);
85 tmpRgn.translate(-rgn.getBounds().fLeft, -rgn.getBounds().fTop); 85 tmpRgn.translate(-rgn.getBounds().fLeft, -rgn.getBounds().fTop);
86 86
87 SkCanvas canvas(bitmap); 87 SkCanvas canvas(bitmap);
88 canvas.clipRegion(tmpRgn); 88 canvas.clipRegion(tmpRgn);
89 canvas.drawColor(SK_ColorBLACK); 89 canvas.drawColor(SK_ColorBLACK);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 DEF_TEST(AAClip, reporter) { 399 DEF_TEST(AAClip, reporter) {
400 test_empty(reporter); 400 test_empty(reporter);
401 test_path_bounds(reporter); 401 test_path_bounds(reporter);
402 test_irect(reporter); 402 test_irect(reporter);
403 test_rgn(reporter); 403 test_rgn(reporter);
404 test_path_with_hole(reporter); 404 test_path_with_hole(reporter);
405 test_regressions(); 405 test_regressions();
406 test_nearly_integral(reporter); 406 test_nearly_integral(reporter);
407 } 407 }
OLDNEW
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | tests/BitmapGetColorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698