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

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

Issue 2251493003: Adding nullability support to ImageBitmapRenderingContext.transferImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments from patch set 3. Created 4 years, 3 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, 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 bool HTMLCanvasElement::shouldBeDirectComposited() const 251 bool HTMLCanvasElement::shouldBeDirectComposited() const
252 { 252 {
253 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge); 253 return (m_context && m_context->isAccelerated()) || (hasImageBuffer() && buf fer()->isExpensiveToPaint()) || (!!m_surfaceLayerBridge);
254 } 254 }
255 255
256 bool HTMLCanvasElement::isPaintable() const 256 bool HTMLCanvasElement::isPaintable() const
257 { 257 {
258 if (!m_context) 258 if (!m_context)
259 return ImageBuffer::canCreateImageBuffer(size()); 259 return ImageBuffer::canCreateImageBuffer(size());
260 if (renderingContext()->getImage()) 260 if (m_context->getContextType() == CanvasRenderingContext::ContextImageBitma p) {
261 return true; 261 if (renderingContext()->getImage())
Justin Novosad 2016/08/24 15:39:16 Just "return m_context->getImage();" will suffice
zakerinasab 2016/08/24 15:57:12 Used "return renderingContext()->getImage().get();
262 return true;
263 return false;
264 }
262 return buffer(); 265 return buffer();
263 } 266 }
264 267
265 void HTMLCanvasElement::didDraw(const FloatRect& rect) 268 void HTMLCanvasElement::didDraw(const FloatRect& rect)
266 { 269 {
267 if (rect.isEmpty()) 270 if (rect.isEmpty())
268 return; 271 return;
269 m_imageBufferIsClear = false; 272 m_imageBufferIsClear = false;
270 clearCopiedImage(); 273 clearCopiedImage();
271 if (layoutObject()) 274 if (layoutObject())
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 1236
1234 bool HTMLCanvasElement::createSurfaceLayer() 1237 bool HTMLCanvasElement::createSurfaceLayer()
1235 { 1238 {
1236 DCHECK(!m_surfaceLayerBridge); 1239 DCHECK(!m_surfaceLayerBridge);
1237 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl()); 1240 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne w CanvasSurfaceLayerBridgeClientImpl());
1238 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient))); 1241 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri dgeClient)));
1239 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( )); 1242 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height( ));
1240 } 1243 }
1241 1244
1242 } // namespace blink 1245 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698