Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@5539 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
skia.committer@gmail.com 2012-09-14 02:01:10 +00:00
parent 90f2d07d34
commit 1d225f2b33
5 changed files with 8 additions and 8 deletions

View File

@ -78,7 +78,7 @@ public:
but allows us to perform much faster culling at playback time, and
completely avoid some unnecessary clips and other operations. This
is ideal for tiled rendering, or any other situation where you're
drawing a fraction of a large scene into a smaller viewport.
drawing a fraction of a large scene into a smaller viewport.
In most cases the record cost is offset by the playback improvement
after a frame or two of tiled rendering (and complex pictures that

View File

@ -217,7 +217,7 @@ void SkBBoxRecord::drawVertices(VertexMode mode, int vertexCount,
}
void SkBBoxRecord::drawPicture(SkPicture& picture) {
if (picture.width() > 0 && picture.height() > 0 &&
if (picture.width() > 0 && picture.height() > 0 &&
this->transformBounds(SkRect::MakeWH(picture.width(), picture.height()), NULL)) {
INHERITED::drawPicture(picture);
}

View File

@ -186,7 +186,7 @@ SkCanvas* SkPicture::beginRecording(int width, int height,
}
if (recordingFlags & kOptimizeForClippedPlayback_RecordingFlag) {
SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width),
SkScalar aspectRatio = SkScalarDiv(SkIntToScalar(width),
SkIntToScalar(height));
SkRTree* tree = SkRTree::Create(6, 11, aspectRatio);
SkASSERT(NULL != tree);

View File

@ -153,7 +153,7 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInf
fMatrices = SkSafeRef(src.fMatrices);
fRegions = SkSafeRef(src.fRegions);
fOpData = SkSafeRef(src.fOpData);
fBoundingHierarchy = src.fBoundingHierarchy;
fStateTree = src.fStateTree;
@ -593,7 +593,7 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
fBoundingHierarchy->search(query, &results);
if (results.count() == 0) { return; }
SkTQSort<SkPictureStateTree::Draw>(
reinterpret_cast<SkPictureStateTree::Draw**>(results.begin()),
reinterpret_cast<SkPictureStateTree::Draw**>(results.begin()),
reinterpret_cast<SkPictureStateTree::Draw**>(results.end()-1));
}
}

View File

@ -126,7 +126,7 @@ static void render_picture(const SkString& inputPath, const SkString& outputDir,
SkDebugf("drawing... [%i %i] %s\n", picture.width(), picture.height(),
inputPath.c_str());
// rescale to avoid memory issues allcoating a very large offscreen
SkPicture* pic = &picture;
@ -136,13 +136,13 @@ static void render_picture(const SkString& inputPath, const SkString& outputDir,
if (area_too_big(picture.width(), picture.height(), &newSize)) {
pic = new SkPicture;
aur.reset(pic);
SkCanvas* canvas = pic->beginRecording(newSize.width(), newSize.height());
SkScalar scale = SkIntToScalar(newSize.width()) / picture.width();
canvas->scale(scale, scale);
canvas->drawPicture(picture);
pic->endRecording();
SkDebugf("... rescaling to [%d %d] to avoid overly large allocations\n",
newSize.width(), newSize.height());
}