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

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

Issue 364823009: Port suitableForGpuRasterization to SkRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More SkPicture.h cleanup Created 6 years, 4 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 "SkBBoxHierarchyRecord.h" 8 #include "SkBBoxHierarchyRecord.h"
9 #include "SkPictureRecord.h" 9 #include "SkPictureRecord.h"
10 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
11 #include "SkRecord.h" 11 #include "SkRecord.h"
12 #include "SkRecordAnalysis.h"
12 #include "SkRecordDraw.h" 13 #include "SkRecordDraw.h"
13 #include "SkRecorder.h" 14 #include "SkRecorder.h"
14 #include "SkTypes.h" 15 #include "SkTypes.h"
15 16
16 SkPictureRecorder::SkPictureRecorder() {} 17 SkPictureRecorder::SkPictureRecorder() {}
17 18
18 SkPictureRecorder::~SkPictureRecorder() {} 19 SkPictureRecorder::~SkPictureRecorder() {}
19 20
20 SkCanvas* SkPictureRecorder::beginRecording(int width, int height, 21 SkCanvas* SkPictureRecorder::beginRecording(int width, int height,
21 SkBBHFactory* bbhFactory /* = NULL * /, 22 SkBBHFactory* bbhFactory /* = NULL * /,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 if (NULL != fRecorder.get()) { 59 if (NULL != fRecorder.get()) {
59 return fRecorder.get(); 60 return fRecorder.get();
60 } 61 }
61 return fPictureRecord.get(); 62 return fPictureRecord.get();
62 } 63 }
63 64
64 SkPicture* SkPictureRecorder::endRecording() { 65 SkPicture* SkPictureRecorder::endRecording() {
65 SkPicture* picture = NULL; 66 SkPicture* picture = NULL;
66 67
67 if (NULL != fRecord.get()) { 68 if (NULL != fRecord.get()) {
69 fRecord->fAccelerationInfo = AnalyzeSkRecord(*fRecord.get());
68 picture = SkNEW_ARGS(SkPicture, (fWidth, fHeight, fRecord.detach(), fBBH .get())); 70 picture = SkNEW_ARGS(SkPicture, (fWidth, fHeight, fRecord.detach(), fBBH .get()));
69 } 71 }
70 72
71 if (NULL != fPictureRecord.get()) { 73 if (NULL != fPictureRecord.get()) {
72 fPictureRecord->endRecording(); 74 fPictureRecord->endRecording();
73 const bool deepCopyOps = false; 75 const bool deepCopyOps = false;
74 picture = SkNEW_ARGS(SkPicture, (fWidth, fHeight, *fPictureRecord.get(), deepCopyOps)); 76 picture = SkNEW_ARGS(SkPicture, (fWidth, fHeight, *fPictureRecord.get(), deepCopyOps));
75 } 77 }
76 78
77 return picture; 79 return picture;
(...skipping 13 matching lines...) Expand all
91 if (NULL != fRecord.get()) { 93 if (NULL != fRecord.get()) {
92 SkRecordDraw(*fRecord, canvas, NULL/*bbh*/, NULL/*callback*/); 94 SkRecordDraw(*fRecord, canvas, NULL/*bbh*/, NULL/*callback*/);
93 } 95 }
94 96
95 if (NULL != fPictureRecord.get()) { 97 if (NULL != fPictureRecord.get()) {
96 const bool deepCopyOps = true; 98 const bool deepCopyOps = true;
97 SkPicture picture(fWidth, fHeight, *fPictureRecord.get(), deepCopyOps); 99 SkPicture picture(fWidth, fHeight, *fPictureRecord.get(), deepCopyOps);
98 picture.draw(canvas); 100 picture.draw(canvas);
99 } 101 }
100 } 102 }
OLDNEW
« no previous file with comments | « src/core/SkPictureAnalysis.h ('k') | src/core/SkRecord.h » ('j') | src/core/SkRecord.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698