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

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

Issue 741093002: SkRecord: Pack SkRegion::Op and AA bit together. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MSVC, your whims are seemingly arbitrary. Created 6 years, 1 month 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/SkRecordDraw.cpp ('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 "SkData.h" 8 #include "SkData.h"
9 #include "SkRecorder.h" 9 #include "SkRecorder.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 SkDEVCODE(if (matrix != this->getTotalMatrix()) { 334 SkDEVCODE(if (matrix != this->getTotalMatrix()) {
335 matrix.dump(); 335 matrix.dump();
336 this->getTotalMatrix().dump(); 336 this->getTotalMatrix().dump();
337 SkASSERT(matrix == this->getTotalMatrix()); 337 SkASSERT(matrix == this->getTotalMatrix());
338 }) 338 })
339 APPEND(SetMatrix, matrix); 339 APPEND(SetMatrix, matrix);
340 } 340 }
341 341
342 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 342 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
343 INHERITED(onClipRect, rect, op, edgeStyle); 343 INHERITED(onClipRect, rect, op, edgeStyle);
344 APPEND(ClipRect, this->devBounds(), rect, op, edgeStyle == kSoft_ClipEdgeSty le); 344 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
345 APPEND(ClipRect, this->devBounds(), rect, opAA);
345 } 346 }
346 347
347 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) { 348 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) {
348 INHERITED(onClipRRect, rrect, op, edgeStyle); 349 INHERITED(onClipRRect, rrect, op, edgeStyle);
349 APPEND(ClipRRect, this->devBounds(), rrect, op, edgeStyle == kSoft_ClipEdgeS tyle); 350 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
351 APPEND(ClipRRect, this->devBounds(), rrect, opAA);
350 } 352 }
351 353
352 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 354 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
353 INHERITED(onClipPath, path, op, edgeStyle); 355 INHERITED(onClipPath, path, op, edgeStyle);
354 APPEND(ClipPath, this->devBounds(), delay_copy(path), op, edgeStyle == kSoft _ClipEdgeStyle); 356 SkRecords::RegionOpAndAA opAA(op, kSoft_ClipEdgeStyle == edgeStyle);
357 APPEND(ClipPath, this->devBounds(), delay_copy(path), opAA);
355 } 358 }
356 359
357 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 360 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
358 INHERITED(onClipRegion, deviceRgn, op); 361 INHERITED(onClipRegion, deviceRgn, op);
359 APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op); 362 APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op);
360 } 363 }
361 364
362 void SkRecorder::beginCommentGroup(const char* description) { 365 void SkRecorder::beginCommentGroup(const char* description) {
363 APPEND(BeginCommentGroup, this->copy(description)); 366 APPEND(BeginCommentGroup, this->copy(description));
364 } 367 }
365 368
366 void SkRecorder::addComment(const char* key, const char* value) { 369 void SkRecorder::addComment(const char* key, const char* value) {
367 APPEND(AddComment, this->copy(key), this->copy(value)); 370 APPEND(AddComment, this->copy(key), this->copy(value));
368 } 371 }
369 372
370 void SkRecorder::endCommentGroup() { 373 void SkRecorder::endCommentGroup() {
371 APPEND(EndCommentGroup); 374 APPEND(EndCommentGroup);
372 } 375 }
373 376
374 bool SkRecorder::isDrawingToLayer() const { 377 bool SkRecorder::isDrawingToLayer() const {
375 return fSaveLayerCount > 0; 378 return fSaveLayerCount > 0;
376 } 379 }
377 380
378 void SkRecorder::drawData(const void* data, size_t length) { 381 void SkRecorder::drawData(const void* data, size_t length) {
379 APPEND(DrawData, copy((const char*)data), length); 382 APPEND(DrawData, copy((const char*)data), length);
380 } 383 }
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.cpp ('k') | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698