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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 context.beginRecording(bounds); 111 context.beginRecording(bounds);
112 112
113 context.setShouldAntialias(false); 113 context.setShouldAntialias(false);
114 context.setMiterLimit(1); 114 context.setMiterLimit(1);
115 context.setStrokeThickness(5); 115 context.setStrokeThickness(5);
116 context.setLineCap(SquareCap); 116 context.setLineCap(SquareCap);
117 context.setStrokeStyle(SolidStroke); 117 context.setStrokeStyle(SolidStroke);
118 118
119 // Make skia unable to compute fast bounds for our paths. 119 // Make skia unable to compute fast bounds for our paths.
120 DashArray dashArray; 120 DashArray dashArray;
121 dashArray.append(1); 121 dashArray.push_back(1);
122 dashArray.append(0); 122 dashArray.push_back(0);
123 context.setLineDash(dashArray, 0); 123 context.setLineDash(dashArray, 0);
124 124
125 // Make the device opaque in 10,10 40x40. 125 // Make the device opaque in 10,10 40x40.
126 context.fillRect(FloatRect(10, 10, 40, 40), opaque, SkBlendMode::kSrcOver); 126 context.fillRect(FloatRect(10, 10, 40, 40), opaque, SkBlendMode::kSrcOver);
127 sk_sp<const SkPicture> picture = context.endRecording(); 127 sk_sp<const SkPicture> picture = context.endRecording();
128 canvas.drawPicture(picture.get()); 128 canvas.drawPicture(picture.get());
129 EXPECT_OPAQUE_PIXELS_ONLY_IN_RECT(bitmap, IntRect(10, 10, 40, 40)); 129 EXPECT_OPAQUE_PIXELS_ONLY_IN_RECT(bitmap, IntRect(10, 10, 40, 40));
130 130
131 context.beginRecording(bounds); 131 context.beginRecording(bounds);
132 // Clip to the left edge of the opaque area. 132 // Clip to the left edge of the opaque area.
133 context.clip(IntRect(10, 10, 10, 40)); 133 context.clip(IntRect(10, 10, 10, 40));
134 134
135 // Draw a path that gets clipped. This should destroy the opaque area, but 135 // Draw a path that gets clipped. This should destroy the opaque area, but
136 // only inside the clip. 136 // only inside the clip.
137 Path path; 137 Path path;
138 path.moveTo(FloatPoint(10, 10)); 138 path.moveTo(FloatPoint(10, 10));
139 path.addLineTo(FloatPoint(40, 40)); 139 path.addLineTo(FloatPoint(40, 40));
140 SkPaint paint; 140 SkPaint paint;
141 paint.setColor(alpha.rgb()); 141 paint.setColor(alpha.rgb());
142 paint.setBlendMode(SkBlendMode::kSrcOut); 142 paint.setBlendMode(SkBlendMode::kSrcOut);
143 context.drawPath(path.getSkPath(), paint); 143 context.drawPath(path.getSkPath(), paint);
144 144
145 picture = context.endRecording(); 145 picture = context.endRecording();
146 canvas.drawPicture(picture.get()); 146 canvas.drawPicture(picture.get());
147 EXPECT_OPAQUE_PIXELS_IN_RECT(bitmap, IntRect(20, 10, 30, 40)); 147 EXPECT_OPAQUE_PIXELS_IN_RECT(bitmap, IntRect(20, 10, 30, 40));
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698