diff options
-rw-r--r-- | include/core/SkPicture.h | 2 | ||||
-rw-r--r-- | src/core/SkBBoxRecord.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPicture.cpp | 2 | ||||
-rw-r--r-- | src/core/SkPicturePlayback.cpp | 4 | ||||
-rw-r--r-- | tools/render_pictures_main.cpp | 6 |
5 files changed, 8 insertions, 8 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 0d1a268878..70867b4e6a 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -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 diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp index 272f826f96..41f6b95516 100644 --- a/src/core/SkBBoxRecord.cpp +++ b/src/core/SkBBoxRecord.cpp @@ -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); } diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index af1cd60cbf..4405094314 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -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); diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp index 3df113ca26..41872f831c 100644 --- a/src/core/SkPicturePlayback.cpp +++ b/src/core/SkPicturePlayback.cpp @@ -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)); } } diff --git a/tools/render_pictures_main.cpp b/tools/render_pictures_main.cpp index 613ec94c03..87d5d4b79e 100644 --- a/tools/render_pictures_main.cpp +++ b/tools/render_pictures_main.cpp @@ -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()); } |