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

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

Issue 1181913003: add SkCanvas::drawAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add virtuals for device and picture Created 5 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
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 "SkBigPicture.h" 8 #include "SkBigPicture.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], 293 void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
294 const SkPoint texCoords[4], SkXfermode* xmode, cons t SkPaint& paint) { 294 const SkPoint texCoords[4], SkXfermode* xmode, cons t SkPaint& paint) {
295 APPEND(DrawPatch, delay_copy(paint), 295 APPEND(DrawPatch, delay_copy(paint),
296 cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL, 296 cubics ? this->copy(cubics, SkPatchUtils::kNumCtrlPts) : NULL,
297 colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL, 297 colors ? this->copy(colors, SkPatchUtils::kNumCorners) : NULL,
298 texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL, 298 texCoords ? this->copy(texCoords, SkPatchUtils::kNumCorners) : NULL,
299 xmode); 299 xmode);
300 } 300 }
301 301
302 void SkRecorder::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[], cons t SkRect tex[],
303 const SkColor colors[], int count, const SkRect* cu ll,
304 const SkPaint* paint) {
305 APPEND(DrawAtlas, this->copy(paint),
306 atlas,
307 this->copy(xform, count),
308 this->copy(tex, count),
309 colors ? this->copy(colors, count) : NULL,
mtklein 2015/06/15 20:45:40 This is fine, but copy does this check internally
reed1 2015/06/15 20:59:18 Ah, ok. I was trying to copy the pattern above on
310 count,
311 this->copy(cull));
312 }
313
302 void SkRecorder::willSave() { 314 void SkRecorder::willSave() {
303 APPEND(Save); 315 APPEND(Save);
304 } 316 }
305 317
306 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, 318 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
307 const SkPaint* paint, 319 const SkPaint* paint,
308 SkCanvas::SaveFlags flags) { 320 SkCanvas::SaveFlags flags) {
309 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); 321 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags);
310 return SkCanvas::kNoLayer_SaveLayerStrategy; 322 return SkCanvas::kNoLayer_SaveLayerStrategy;
311 } 323 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 367 }
356 368
357 void SkRecorder::addComment(const char* key, const char* value) { 369 void SkRecorder::addComment(const char* key, const char* value) {
358 APPEND(AddComment, this->copy(key), this->copy(value)); 370 APPEND(AddComment, this->copy(key), this->copy(value));
359 } 371 }
360 372
361 void SkRecorder::endCommentGroup() { 373 void SkRecorder::endCommentGroup() {
362 APPEND(EndCommentGroup); 374 APPEND(EndCommentGroup);
363 } 375 }
364 376
OLDNEW
« src/core/SkRecordDraw.cpp ('K') | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698