Changeset 116806 in webkit
- Timestamp:
- May 11, 2012 2:40:50 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116803 r116806 1 2012-05-11 Keyar Hood <keyar@chromium.org> 2 3 ImageSkia.cpp does not conform to style guidelines 4 https://bugs.webkit.org/show_bug.cgi?id=86219 5 6 Reviewed by Stephen White. 7 8 No tests as this is purely style changees. 9 10 * platform/graphics/skia/ImageSkia.cpp: 11 (WebCore::TransformDimensions): 12 (WebCore::BitmapImage::draw): 13 (WebCore::BitmapImageSingleFrameSkia::draw): 14 1 15 2012-05-11 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/Source/WebCore/platform/graphics/skia/ImageSkia.cpp
r113373 r116806 254 254 // Transforms the given dimensions with the given matrix. Used to see how big 255 255 // images will be once transformed. 256 static void TransformDimensions(const SkMatrix& matrix, float srcWidth, float srcHeight, float* destWidth, float* destHeight) { 256 static void TransformDimensions(const SkMatrix& matrix, float srcWidth, float srcHeight, float* destWidth, float* destHeight) 257 { 257 258 // Transform 3 points to see how long each side of the bitmap will be. 258 SkPoint src _points[3];// (0, 0), (width, 0), (0, height).259 src _points[0].set(0, 0);260 src _points[1].set(SkFloatToScalar(srcWidth), 0);261 src _points[2].set(0, SkFloatToScalar(srcHeight));259 SkPoint srcPoints[3]; // (0, 0), (width, 0), (0, height). 260 srcPoints[0].set(0, 0); 261 srcPoints[1].set(SkFloatToScalar(srcWidth), 0); 262 srcPoints[2].set(0, SkFloatToScalar(srcHeight)); 262 263 263 264 // Now measure the length of the two transformed vectors relative to the 264 265 // transformed origin to see how big the bitmap will be. Note: for skews, 265 266 // this isn't the best thing, but we don't have skews. 266 SkPoint dest _points[3];267 matrix.mapPoints(dest _points, src_points, 3);268 *destWidth = SkScalarToFloat((dest _points[1] - dest_points[0]).length());269 *destHeight = SkScalarToFloat((dest _points[2] - dest_points[0]).length());267 SkPoint destPoints[3]; 268 matrix.mapPoints(destPoints, srcPoints, 3); 269 *destWidth = SkScalarToFloat((destPoints[1] - destPoints[0]).length()); 270 *destHeight = SkScalarToFloat((destPoints[2] - destPoints[0]).length()); 270 271 } 271 272 … … 429 430 NativeImageSkia* bm = nativeImageForCurrentFrame(); 430 431 if (!bm) 431 return; 432 return; // It's too early and we don't have an image yet. 432 433 433 434 FloatRect normDstRect = normalizeRect(dstRect); … … 435 436 436 437 if (normSrcRect.isEmpty() || normDstRect.isEmpty()) 437 return; 438 return; // Nothing to draw. 438 439 439 440 paintSkBitmap(ctxt->platformContext(), … … 459 460 460 461 if (normSrcRect.isEmpty() || normDstRect.isEmpty()) 461 return; 462 return; // Nothing to draw. 462 463 463 464 paintSkBitmap(ctxt->platformContext(), … … 487 488 } 488 489 489 } 490 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.