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

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

Issue 343273002: Revert r175934 "Accelerate small canvases if Ganesh is on." (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 | Source/core/loader/EmptyClients.h » ('j') | 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 24 matching lines...) Expand all
35 #include "core/dom/Document.h" 35 #include "core/dom/Document.h"
36 #include "core/dom/ExceptionCode.h" 36 #include "core/dom/ExceptionCode.h"
37 #include "core/frame/LocalFrame.h" 37 #include "core/frame/LocalFrame.h"
38 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
39 #include "core/html/ImageData.h" 39 #include "core/html/ImageData.h"
40 #include "core/html/canvas/Canvas2DContextAttributes.h" 40 #include "core/html/canvas/Canvas2DContextAttributes.h"
41 #include "core/html/canvas/CanvasRenderingContext2D.h" 41 #include "core/html/canvas/CanvasRenderingContext2D.h"
42 #include "core/html/canvas/WebGLContextAttributes.h" 42 #include "core/html/canvas/WebGLContextAttributes.h"
43 #include "core/html/canvas/WebGLContextEvent.h" 43 #include "core/html/canvas/WebGLContextEvent.h"
44 #include "core/html/canvas/WebGLRenderingContext.h" 44 #include "core/html/canvas/WebGLRenderingContext.h"
45 #include "core/page/ChromeClient.h"
46 #include "core/rendering/RenderHTMLCanvas.h" 45 #include "core/rendering/RenderHTMLCanvas.h"
47 #include "platform/MIMETypeRegistry.h" 46 #include "platform/MIMETypeRegistry.h"
48 #include "platform/RuntimeEnabledFeatures.h" 47 #include "platform/RuntimeEnabledFeatures.h"
49 #include "platform/graphics/Canvas2DImageBufferSurface.h" 48 #include "platform/graphics/Canvas2DImageBufferSurface.h"
50 #include "platform/graphics/GraphicsContextStateSaver.h" 49 #include "platform/graphics/GraphicsContextStateSaver.h"
51 #include "platform/graphics/ImageBuffer.h" 50 #include "platform/graphics/ImageBuffer.h"
52 #include "platform/graphics/UnacceleratedImageBufferSurface.h" 51 #include "platform/graphics/UnacceleratedImageBufferSurface.h"
53 #include "platform/graphics/gpu/WebGLImageBufferSurface.h" 52 #include "platform/graphics/gpu/WebGLImageBufferSurface.h"
54 #include "platform/transforms/AffineTransform.h" 53 #include "platform/transforms/AffineTransform.h"
55 #include "public/platform/Platform.h" 54 #include "public/platform/Platform.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (m_context && !m_context->is2d()) 427 if (m_context && !m_context->is2d())
429 return false; 428 return false;
430 429
431 if (m_accelerationDisabled) 430 if (m_accelerationDisabled)
432 return false; 431 return false;
433 432
434 Settings* settings = document().settings(); 433 Settings* settings = document().settings();
435 if (!settings || !settings->accelerated2dCanvasEnabled()) 434 if (!settings || !settings->accelerated2dCanvasEnabled())
436 return false; 435 return false;
437 436
438 // Do not use acceleration for small canvases, unless GPU rasterization is a vailable. 437 // Do not use acceleration for small canvas.
439 // GPU raterization is a heuristic to avoid difficult content & whitelist ta rgeted content. 438 if (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; 439 return false;
442 440
443 if (!blink::Platform::current()->canAccelerate2dCanvas()) 441 if (!blink::Platform::current()->canAccelerate2dCanvas())
444 return false; 442 return false;
445 443
446 return true; 444 return true;
447 } 445 }
448 446
449 PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount) 447 PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const IntSize& deviceSize, int* msaaSampleCount)
450 { 448 {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 { 700 {
703 return !originClean(); 701 return !originClean();
704 } 702 }
705 703
706 FloatSize HTMLCanvasElement::sourceSize() const 704 FloatSize HTMLCanvasElement::sourceSize() const
707 { 705 {
708 return FloatSize(width(), height()); 706 return FloatSize(width(), height());
709 } 707 }
710 708
711 } 709 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/loader/EmptyClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698