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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 251023004: WebGL: Free temporary GPU resources held by inactive or hidden WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add a layout test Created 6 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 2251 matching lines...) Expand 10 before | Expand all | Expand 10 after
2262 case MiddleTextBaseline: 2262 case MiddleTextBaseline:
2263 return -fontMetrics.descent() + fontMetrics.height() / 2; 2263 return -fontMetrics.descent() + fontMetrics.height() / 2;
2264 case AlphabeticTextBaseline: 2264 case AlphabeticTextBaseline:
2265 default: 2265 default:
2266 // Do nothing. 2266 // Do nothing.
2267 break; 2267 break;
2268 } 2268 }
2269 return 0; 2269 return 0;
2270 } 2270 }
2271 2271
2272 void CanvasRenderingContext2D::setIsHidden(bool hidden)
2273 {
2274 ImageBuffer* buffer = canvas()->buffer();
2275 if (buffer)
2276 buffer->setIsHidden(hidden);
2277 }
2278
2272 blink::WebLayer* CanvasRenderingContext2D::platformLayer() const 2279 blink::WebLayer* CanvasRenderingContext2D::platformLayer() const
2273 { 2280 {
2274 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0; 2281 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0;
2275 } 2282 }
2276 2283
2277 bool CanvasRenderingContext2D::imageSmoothingEnabled() const 2284 bool CanvasRenderingContext2D::imageSmoothingEnabled() const
2278 { 2285 {
2279 return state().m_imageSmoothingEnabled; 2286 return state().m_imageSmoothingEnabled;
2280 } 2287 }
2281 2288
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2446 2453
2447 unsigned CanvasRenderingContext2D::hitRegionsCount() const 2454 unsigned CanvasRenderingContext2D::hitRegionsCount() const
2448 { 2455 {
2449 if (m_hitRegionManager) 2456 if (m_hitRegionManager)
2450 return m_hitRegionManager->getHitRegionsCount(); 2457 return m_hitRegionManager->getHitRegionsCount();
2451 2458
2452 return 0; 2459 return 0;
2453 } 2460 }
2454 2461
2455 } // namespace WebCore 2462 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698