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

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

Issue 316063005: Fix error revealed by Android unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix typo Created 6 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
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | tests/PictureTest.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 "SkBBoxHierarchyRecord.h" 8 #include "SkBBoxHierarchyRecord.h"
9 #include "SkPicturePlayback.h" 9 #include "SkPicturePlayback.h"
10 #include "SkPictureRecord.h" 10 #include "SkPictureRecord.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return NULL; 48 return NULL;
49 } 49 }
50 50
51 SkASSERT(NULL == fPicture->fPlayback); 51 SkASSERT(NULL == fPicture->fPlayback);
52 SkASSERT(NULL != fCanvas); 52 SkASSERT(NULL != fCanvas);
53 53
54 fCanvas->endRecording(); 54 fCanvas->endRecording();
55 55
56 SkPictInfo info; 56 SkPictInfo info;
57 fPicture->createHeader(&info); 57 fPicture->createHeader(&info);
58 fPicture->fPlayback = SkNEW_ARGS(SkPicturePlayback, (fPicture, *fCanvas, inf o)); 58 const bool deepCopyOps = false;
59 fPicture->fPlayback = SkNEW_ARGS(SkPicturePlayback, (fPicture, *fCanvas, inf o, deepCopyOps));
59 60
60 SkSafeSetNull(fCanvas); 61 SkSafeSetNull(fCanvas);
61 62
62 return fPicture.detach(); 63 return fPicture.detach();
63 } 64 }
64 65
65 void SkPictureRecorder::internalOnly_EnableOpts(bool enableOpts) { 66 void SkPictureRecorder::internalOnly_EnableOpts(bool enableOpts) {
66 if (NULL != fCanvas) { 67 if (NULL != fCanvas) {
67 fCanvas->internalOnly_EnableOpts(enableOpts); 68 fCanvas->internalOnly_EnableOpts(enableOpts);
68 } 69 }
69 } 70 }
70 71
71 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const { 72 void SkPictureRecorder::partialReplay(SkCanvas* canvas) const {
72 if (NULL == fPicture.get() || NULL == canvas) { 73 if (NULL == fPicture.get() || NULL == canvas) {
73 // Not recording or nothing to replay into 74 // Not recording or nothing to replay into
74 return; 75 return;
75 } 76 }
76 77
77 SkASSERT(NULL != fCanvas); 78 SkASSERT(NULL != fCanvas);
78 79
79 SkAutoTDelete<SkPicturePlayback> playback(SkPicture::FakeEndRecording(fPictu re.get(), 80 SkAutoTDelete<SkPicturePlayback> playback(SkPicture::FakeEndRecording(fPictu re.get(),
80 *fCanv as)); 81 *fCanv as));
81 playback->draw(*canvas, NULL); 82 playback->draw(*canvas, NULL);
82 } 83 }
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698