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

Side by Side Diff: src/core/SkRecorder.cpp

Issue 463493002: SkCanvas::drawPatch param SkPoint[12] (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Removed GPU headers from GM Created 6 years, 4 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/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 "SkRecorder.h" 8 #include "SkRecorder.h"
9 #include "SkPatchUtils.h"
9 #include "SkPicture.h" 10 #include "SkPicture.h"
10 11
11 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h eight. 12 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h eight.
12 SkRecorder::SkRecorder(SkRecord* record, int width, int height) 13 SkRecorder::SkRecorder(SkRecord* record, int width, int height)
13 : SkCanvas(width, height), fRecord(record) {} 14 : SkCanvas(width, height), fRecord(record) {}
14 15
15 void SkRecorder::forgetRecord() { 16 void SkRecorder::forgetRecord() {
16 fRecord = NULL; 17 fRecord = NULL;
17 } 18 }
18 19
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 vmode, 200 vmode,
200 vertexCount, 201 vertexCount,
201 this->copy(vertices, vertexCount), 202 this->copy(vertices, vertexCount),
202 texs ? this->copy(texs, vertexCount) : NULL, 203 texs ? this->copy(texs, vertexCount) : NULL,
203 colors ? this->copy(colors, vertexCount) : NULL, 204 colors ? this->copy(colors, vertexCount) : NULL,
204 xmode, 205 xmode,
205 this->copy(indices, indexCount), 206 this->copy(indices, indexCount),
206 indexCount); 207 indexCount);
207 } 208 }
208 209
209 void SkRecorder::drawPatch(const SkPatch& patch, const SkPaint& paint) { 210 void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
210 APPEND(DrawPatch, delay_copy(paint), delay_copy(patch)); 211 const SkPoint texCoords[4], SkXfermode* xmode, cons t SkPaint& paint) {
212 APPEND(DrawPatch, delay_copy(paint),
213 cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL,
214 colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL,
215 texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL,
216 xmode);
211 } 217 }
212 218
213 void SkRecorder::willSave() { 219 void SkRecorder::willSave() {
214 APPEND(Save); 220 APPEND(Save);
215 INHERITED(willSave); 221 INHERITED(willSave);
216 } 222 }
217 223
218 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, 224 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
219 const SkPaint* paint, 225 const SkPaint* paint,
220 SkCanvas::SaveFlags flags) { 226 SkCanvas::SaveFlags flags) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 264
259 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 265 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
260 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); 266 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle);
261 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType()); 267 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType());
262 } 268 }
263 269
264 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 270 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
265 APPEND(ClipRegion, delay_copy(deviceRgn), op); 271 APPEND(ClipRegion, delay_copy(deviceRgn), op);
266 INHERITED(onClipRegion, deviceRgn, op); 272 INHERITED(onClipRegion, deviceRgn, op);
267 } 273 }
OLDNEW
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698