Correctly set width & height in filtered SkPictures
https://codereview.appspot.com/6772047/ git-svn-id: http://skia.googlecode.com/svn/trunk@6103 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
422e81aeb1
commit
831c726f83
@ -148,12 +148,13 @@ public:
|
||||
void abortPlayback();
|
||||
|
||||
protected:
|
||||
// fRecord is protected to allow derived classes to install their own
|
||||
// SkPictureRecord-derived recorders.
|
||||
// fRecord and fWidth & fHeight are protected to allow derived classes to
|
||||
// install their own SkPictureRecord-derived recorders and set the picture
|
||||
// size
|
||||
SkPictureRecord* fRecord;
|
||||
int fWidth, fHeight;
|
||||
|
||||
private:
|
||||
int fWidth, fHeight;
|
||||
SkPicturePlayback* fPlayback;
|
||||
|
||||
/** Used by the R-Tree when kOptimizeForClippedPlayback_RecordingFlag is
|
||||
|
@ -95,7 +95,9 @@ private:
|
||||
// Wrap SkPicture to allow installation of a SkFilterRecord object
|
||||
class SkFilterPicture : public SkPicture {
|
||||
public:
|
||||
SkFilterPicture(SkPictureRecord* record) {
|
||||
SkFilterPicture(int width, int height, SkPictureRecord* record) {
|
||||
fWidth = width;
|
||||
fHeight = height;
|
||||
fRecord = record;
|
||||
SkSafeRef(fRecord);
|
||||
}
|
||||
@ -187,7 +189,7 @@ int tool_main(int argc, char** argv) {
|
||||
filterRecord->report();
|
||||
|
||||
if (!outFile.isEmpty()) {
|
||||
SkFilterPicture outPicture(filterRecord);
|
||||
SkFilterPicture outPicture(inPicture->width(), inPicture->height(), filterRecord);
|
||||
SkFILEWStream outStream(outFile.c_str());
|
||||
|
||||
outPicture.serialize(&outStream);
|
||||
|
Loading…
Reference in New Issue
Block a user