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

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

Issue 778563002: Revert "Change clear() to respect the clip" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/SkPictureRecord.h ('k') | src/core/SkRecordDraw.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 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 "SkPictureRecord.h" 8 #include "SkPictureRecord.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 size_t initialOffset = this->addDraw(CLIP_REGION, &size); 454 size_t initialOffset = this->addDraw(CLIP_REGION, &size);
455 this->addRegion(region); 455 this->addRegion(region);
456 this->addInt(ClipParams_pack(op, false)); 456 this->addInt(ClipParams_pack(op, false));
457 size_t offset = this->recordRestoreOffsetPlaceholder(op); 457 size_t offset = this->recordRestoreOffsetPlaceholder(op);
458 458
459 this->validate(initialOffset, size); 459 this->validate(initialOffset, size);
460 return offset; 460 return offset;
461 } 461 }
462 462
463 void SkPictureRecord::clear(SkColor color) {
464 // op + color
465 size_t size = 2 * kUInt32Size;
466 size_t initialOffset = this->addDraw(DRAW_CLEAR, &size);
467 this->addInt(color);
468 this->validate(initialOffset, size);
469 }
470
463 void SkPictureRecord::drawPaint(const SkPaint& paint) { 471 void SkPictureRecord::drawPaint(const SkPaint& paint) {
464 // op + paint index 472 // op + paint index
465 size_t size = 2 * kUInt32Size; 473 size_t size = 2 * kUInt32Size;
466 size_t initialOffset = this->addDraw(DRAW_PAINT, &size); 474 size_t initialOffset = this->addDraw(DRAW_PAINT, &size);
467 SkASSERT(initialOffset+get_paint_offset(DRAW_PAINT, size) == fWriter.bytesWr itten()); 475 SkASSERT(initialOffset+get_paint_offset(DRAW_PAINT, size) == fWriter.bytesWr itten());
468 this->addPaint(paint); 476 this->addPaint(paint);
469 this->validate(initialOffset, size); 477 this->validate(initialOffset, size);
470 } 478 }
471 479
472 void SkPictureRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts [], 480 void SkPictureRecord::drawPoints(PointMode mode, size_t count, const SkPoint pts [],
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) { 1060 void SkPictureRecord::addTextBlob(const SkTextBlob *blob) {
1053 int index = fTextBlobRefs.count(); 1061 int index = fTextBlobRefs.count();
1054 *fTextBlobRefs.append() = blob; 1062 *fTextBlobRefs.append() = blob;
1055 blob->ref(); 1063 blob->ref();
1056 // follow the convention of recording a 1-based index 1064 // follow the convention of recording a 1-based index
1057 this->addInt(index + 1); 1065 this->addInt(index + 1);
1058 } 1066 }
1059 1067
1060 /////////////////////////////////////////////////////////////////////////////// 1068 ///////////////////////////////////////////////////////////////////////////////
1061 1069
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/core/SkRecordDraw.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698