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

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 336653003: Fix crash due to null frame() pointer on Document. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 430
431 if (m_accelerationDisabled) 431 if (m_accelerationDisabled)
432 return false; 432 return false;
433 433
434 Settings* settings = document().settings(); 434 Settings* settings = document().settings();
435 if (!settings || !settings->accelerated2dCanvasEnabled()) 435 if (!settings || !settings->accelerated2dCanvasEnabled())
436 return false; 436 return false;
437 437
438 // Do not use acceleration for small canvases, unless GPU rasterization is a vailable. 438 // Do not use acceleration for small canvases, unless GPU rasterization is a vailable.
439 // GPU raterization is a heuristic to avoid difficult content & whitelist ta rgeted content. 439 // GPU raterization is a heuristic to avoid difficult content & whitelist ta rgeted content.
440 if (!document().frame()->chromeClient().usesGpuRasterization() && size.width () * size.height() < settings->minimumAccelerated2dCanvasSize()) 440 if (!(document().frame() && document().frame()->chromeClient().usesGpuRaster ization()) && size.width() * size.height() < settings->minimumAccelerated2dCanva sSize())
441 return false; 441 return false;
442 442
443 if (!blink::Platform::current()->canAccelerate2dCanvas()) 443 if (!blink::Platform::current()->canAccelerate2dCanvas())
444 return false; 444 return false;
445 445
446 return true; 446 return true;
447 } 447 }
448 448
449 PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount) 449 PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount)
450 { 450 {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 { 701 {
702 return !originClean(); 702 return !originClean();
703 } 703 }
704 704
705 FloatSize HTMLCanvasElement::sourceSize() const 705 FloatSize HTMLCanvasElement::sourceSize() const
706 { 706 {
707 return FloatSize(width(), height()); 707 return FloatSize(width(), height());
708 } 708 }
709 709
710 } 710 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698