Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1716)

Issue 6173046: We were numerically overflowing our 16bit coordinates that we communicate (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by reed1
Modified:
12 years, 3 months ago
Reviewers:
epoger, TomH
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

We were numerically overflowing our 16bit coordinates that we communicate between these two procs. The fixes was in two parts: 1. Just don't draw bitmaps larger than 64K-1 in width or height, since we can't represent those coordinates in our transport format (yet). 2. Perform an unsigned shift during the calculation, so we don't get sign-extension bleed when packing the two values (X,Y) into our 32bit slot. Committed: https://code.google.com/p/skia/source/detail?r=3836

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -11 lines) Patch
M include/core/SkShader.h View 1 2 1 chunk +9 lines, -4 lines 0 comments Download
M src/core/SkBitmapProcShader.cpp View 1 2 1 chunk +11 lines, -1 line 0 comments Download
M src/core/SkBitmapProcState_matrixProcs.cpp View 1 2 4 chunks +13 lines, -6 lines 0 comments Download
M tests/DrawBitmapRectTest.cpp View 1 2 2 chunks +96 lines, -0 lines 0 comments Download

Messages

Total messages: 3
reed1
12 years, 3 months ago (2012-05-03 19:29:40 UTC) #1
TomH
Nice fix! LGTM.
12 years, 3 months ago (2012-05-03 19:41:17 UTC) #2
epoger
12 years, 3 months ago (2012-05-03 20:07:44 UTC) #3
LGTM

https://codereview.appspot.com/6173046/diff/2001/src/core/SkBitmapProcShader.cpp
File src/core/SkBitmapProcShader.cpp (right):

https://codereview.appspot.com/6173046/diff/2001/src/core/SkBitmapProcShader....
src/core/SkBitmapProcShader.cpp:289: if (src.isNull() || bitmapIsTooBig(src)) {
please put a comment in the header file advising callers that you may throw your
hands up in situations like this, and what you will return when you do that.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b