Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: webkit/port/platform/graphics/ImageSkia.cpp

Issue 11580: Fix crashes while displaying large animated GIFs. Our old understanding of t... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/port/platform/graphics/ImageSourceSkia.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 SkPoint dest_points[3]; 283 SkPoint dest_points[3];
284 matrix.mapPoints(dest_points, src_points, 3); 284 matrix.mapPoints(dest_points, src_points, 3);
285 *dest_width = SkScalarToFloat((dest_points[1] - dest_points[0]).length()); 285 *dest_width = SkScalarToFloat((dest_points[1] - dest_points[0]).length());
286 *dest_height = SkScalarToFloat((dest_points[2] - dest_points[0]).length()); 286 *dest_height = SkScalarToFloat((dest_points[2] - dest_points[0]).length());
287 } 287 }
288 288
289 } // namespace 289 } // namespace
290 290
291 void FrameData::clear() 291 void FrameData::clear()
292 { 292 {
293 // The frame data is released in ImageSource::clear. 293 // ImageSource::createFrameAtIndex() allocated |m_frame| and passed
294 // ownership to BitmapImage; we must delete it here.
295 delete m_frame;
294 m_frame = 0; 296 m_frame = 0;
295 // NOTE: We purposefully don't reset metadata here, so that even if we 297 // NOTE: We purposefully don't reset metadata here, so that even if we
296 // throw away previously-decoded data, animation loops can still access 298 // throw away previously-decoded data, animation loops can still access
297 // properties like frame durations without re-decoding. 299 // properties like frame durations without re-decoding.
298 } 300 }
299 301
300 PassRefPtr<Image> Image::loadPlatformResource(const char *name) 302 PassRefPtr<Image> Image::loadPlatformResource(const char *name)
301 { 303 {
302 return ChromiumBridge::loadPlatformImageResource(name); 304 return ChromiumBridge::loadPlatformImageResource(name);
303 } 305 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create( 447 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create(
446 const SkBitmap& bitmap) 448 const SkBitmap& bitmap)
447 { 449 {
448 RefPtr<BitmapImageSingleFrameSkia> image(new BitmapImageSingleFrameSkia()); 450 RefPtr<BitmapImageSingleFrameSkia> image(new BitmapImageSingleFrameSkia());
449 if (!bitmap.copyTo(&image->m_nativeImage, bitmap.config())) 451 if (!bitmap.copyTo(&image->m_nativeImage, bitmap.config()))
450 return 0; 452 return 0;
451 return image.release(); 453 return image.release();
452 } 454 }
453 455
454 } // namespace WebCore 456 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | webkit/port/platform/graphics/ImageSourceSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698