diff options
author | 2012-09-13 21:41:51 +0000 | |
---|---|---|
committer | 2012-09-13 21:41:51 +0000 | |
commit | 8515e79a7699922e0f95f93e8cc11d4c88657c58 (patch) | |
tree | dc78b3eeb9dea5e7efcb7b619171dc6526c7f39a /src/core/SkBBoxRecord.cpp | |
parent | ad0c5d248c5a33388f5b814f160266175b7771b1 (diff) |
Add R-Tree record flag to SkPicture, plus some cleanup/fixes in associated classes.
Review URL: https://codereview.appspot.com/6506103
git-svn-id: http://skia.googlecode.com/svn/trunk@5537 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBBoxRecord.cpp')
-rw-r--r-- | src/core/SkBBoxRecord.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp index 5102de1a16..272f826f96 100644 --- a/src/core/SkBBoxRecord.cpp +++ b/src/core/SkBBoxRecord.cpp @@ -163,8 +163,8 @@ void SkBBoxRecord::drawPosTextH(const void* text, size_t byteLength, const SkSca SkPaint::FontMetrics metrics; paint.getFontMetrics(&metrics); - // pad horizontally by half max glyph height - SkScalar pad = (metrics.fTop - metrics.fBottom) / 2; + // pad horizontally by max glyph height + SkScalar pad = (metrics.fTop - metrics.fBottom); bbox.fLeft += pad; bbox.fRight -= pad; @@ -217,8 +217,8 @@ void SkBBoxRecord::drawVertices(VertexMode mode, int vertexCount, } void SkBBoxRecord::drawPicture(SkPicture& picture) { - SkRect bbox = {0, 0, picture.width(), picture.height()}; - if (this->transformBounds(bbox, NULL)) { + if (picture.width() > 0 && picture.height() > 0 && + this->transformBounds(SkRect::MakeWH(picture.width(), picture.height()), NULL)) { INHERITED::drawPicture(picture); } } |