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

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

Issue 544233002: "NULL !=" = NULL (Closed) Base URL: https://skia.googlesource.com/skia.git@are
Patch Set: rebase Created 6 years, 3 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/SkMessageBus.h ('k') | src/core/SkPaint.cpp » ('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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkMultiPictureDraw.h" 9 #include "SkMultiPictureDraw.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
(...skipping 20 matching lines...) Expand all
31 const SkPaint* paint) { 31 const SkPaint* paint) {
32 if (NULL == canvas || NULL == picture) { 32 if (NULL == canvas || NULL == picture) {
33 SkDEBUGFAIL("parameters to SkMultiPictureDraw::add should be non-NULL"); 33 SkDEBUGFAIL("parameters to SkMultiPictureDraw::add should be non-NULL");
34 return; 34 return;
35 } 35 }
36 36
37 DrawData* data = fDrawData.append(); 37 DrawData* data = fDrawData.append();
38 38
39 data->picture = SkRef(picture); 39 data->picture = SkRef(picture);
40 data->canvas = SkRef(canvas); 40 data->canvas = SkRef(canvas);
41 if (NULL != matrix) { 41 if (matrix) {
42 data->matrix = *matrix; 42 data->matrix = *matrix;
43 } else { 43 } else {
44 data->matrix.setIdentity(); 44 data->matrix.setIdentity();
45 } 45 }
46 if (NULL != paint) { 46 if (paint) {
47 data->paint = SkNEW_ARGS(SkPaint, (*paint)); 47 data->paint = SkNEW_ARGS(SkPaint, (*paint));
48 } else { 48 } else {
49 data->paint = NULL; 49 data->paint = NULL;
50 } 50 }
51 } 51 }
52 52
53 void SkMultiPictureDraw::draw() { 53 void SkMultiPictureDraw::draw() {
54 for (int i = 0; i < fDrawData.count(); ++i) { 54 for (int i = 0; i < fDrawData.count(); ++i) {
55 fDrawData[i].canvas->drawPicture(fDrawData[i].picture, 55 fDrawData[i].canvas->drawPicture(fDrawData[i].picture,
56 &fDrawData[i].matrix, 56 &fDrawData[i].matrix,
57 fDrawData[i].paint); 57 fDrawData[i].paint);
58 } 58 }
59 59
60 this->reset(); 60 this->reset();
61 } 61 }
62 62
OLDNEW
« no previous file with comments | « src/core/SkMessageBus.h ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698