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

Side by Side Diff: Source/core/platform/graphics/gpu/DrawingBuffer.cpp

Issue 19543014: Direct composite canvas background if possible. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: resolved layout test failures Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 WebKit::WebLayer* DrawingBuffer::platformLayer() 300 WebKit::WebLayer* DrawingBuffer::platformLayer()
301 { 301 {
302 if (!m_context) 302 if (!m_context)
303 return 0; 303 return 0;
304 304
305 if (!m_layer) { 305 if (!m_layer) {
306 m_layer = adoptPtr(WebKit::Platform::current()->compositorSupport()->cre ateExternalTextureLayer(this)); 306 m_layer = adoptPtr(WebKit::Platform::current()->compositorSupport()->cre ateExternalTextureLayer(this));
307 307
308 m_layer->setOpaque(!m_attributes.alpha); 308 m_layer->setOpaque(!m_attributes.alpha);
309 m_layer->setBlendBackgroundColor(m_attributes.alpha);
309 m_layer->setPremultipliedAlpha(m_attributes.premultipliedAlpha); 310 m_layer->setPremultipliedAlpha(m_attributes.premultipliedAlpha);
310 GraphicsLayer::registerContentsLayer(m_layer->layer()); 311 GraphicsLayer::registerContentsLayer(m_layer->layer());
311 } 312 }
312 313
313 return m_layer->layer(); 314 return m_layer->layer();
314 } 315 }
315 316
316 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer) 317 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer)
317 { 318 {
318 if (!m_context || !m_context->makeContextCurrent() || m_context->getExtensio ns()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) 319 if (!m_context || !m_context->makeContextCurrent() || m_context->getExtensio ns()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 729
729 void DrawingBuffer::bind() 730 void DrawingBuffer::bind()
730 { 731 {
731 if (!m_context) 732 if (!m_context)
732 return; 733 return;
733 734
734 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo); 735 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO ? m_multisampleFBO : m_fbo);
735 } 736 }
736 737
737 } // namespace WebCore 738 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/chromium/Canvas2DLayerBridge.cpp ('k') | Source/core/rendering/RenderLayerBacking.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698