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

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

Issue 1932223003: Remove SkWriter32::contiguousArray(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 7 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/SkPictureRecord.h ('k') | tests/Writer32Test.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 2016 Google Inc. 2 * Copyright 2016 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 "SkLayerInfo.h" 8 #include "SkLayerInfo.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 bbh = fBBH.get(); 70 bbh = fBBH.get();
71 } 71 }
72 72
73 // Record the draw commands. 73 // Record the draw commands.
74 pictureRecord.beginRecording(); 74 pictureRecord.beginRecording();
75 SkRecordDraw(*fRecord, &pictureRecord, nullptr, fDrawableList->begin(), fDra wableList->count(), 75 SkRecordDraw(*fRecord, &pictureRecord, nullptr, fDrawableList->begin(), fDra wableList->count(),
76 bbh, nullptr); 76 bbh, nullptr);
77 pictureRecord.endRecording(); 77 pictureRecord.endRecording();
78 78
79 // Flatten the recorded commands and drawables. 79 // Flatten the recorded commands and drawables.
80 SkPictureData pictureData(pictureRecord, info, false); 80 SkPictureData pictureData(pictureRecord, info);
81 pictureData.flatten(buffer); 81 pictureData.flatten(buffer);
82 } 82 }
83 83
84 sk_sp<SkFlattenable> SkRecordedDrawable::CreateProc(SkReadBuffer& buffer) { 84 sk_sp<SkFlattenable> SkRecordedDrawable::CreateProc(SkReadBuffer& buffer) {
85 // Read the bounds. 85 // Read the bounds.
86 SkRect bounds; 86 SkRect bounds;
87 buffer.readRect(&bounds); 87 buffer.readRect(&bounds);
88 88
89 // Unflatten into a SkPictureData. 89 // Unflatten into a SkPictureData.
90 SkPictInfo info; 90 SkPictInfo info;
91 info.fCullRect = bounds; 91 info.fCullRect = bounds;
92 SkAutoTDelete<SkPictureData> pictureData(SkPictureData::CreateFromBuffer(buf fer, info)); 92 SkAutoTDelete<SkPictureData> pictureData(SkPictureData::CreateFromBuffer(buf fer, info));
93 if (!pictureData) { 93 if (!pictureData) {
94 return nullptr; 94 return nullptr;
95 } 95 }
96 96
97 // Create a drawable. 97 // Create a drawable.
98 SkPicturePlayback playback(pictureData); 98 SkPicturePlayback playback(pictureData);
99 SkPictureRecorder recorder; 99 SkPictureRecorder recorder;
100 playback.draw(recorder.beginRecording(bounds), nullptr, &buffer); 100 playback.draw(recorder.beginRecording(bounds), nullptr, &buffer);
101 return recorder.finishRecordingAsDrawable(); 101 return recorder.finishRecordingAsDrawable();
102 } 102 }
OLDNEW
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | tests/Writer32Test.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698