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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2212163002: Add some plumbing for the color management of canvases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); 294 m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
295 } 295 }
296 296
297 void CompositedLayerMapping::updateContentsOpaque() 297 void CompositedLayerMapping::updateContentsOpaque()
298 { 298 {
299 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer); 299 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer);
300 if (isAcceleratedCanvas(layoutObject())) { 300 if (isAcceleratedCanvas(layoutObject())) {
301 // Determine whether the rendering context's external texture layer is o paque. 301 // Determine whether the rendering context's external texture layer is o paque.
302 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext(); 302 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext();
303 if (!context->hasAlpha()) 303 if (!context->creationAttributes().alpha())
304 m_graphicsLayer->setContentsOpaque(true); 304 m_graphicsLayer->setContentsOpaque(true);
305 else if (WebLayer* layer = context->platformLayer()) 305 else if (WebLayer* layer = context->platformLayer())
306 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha()); 306 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha());
307 else 307 else
308 m_graphicsLayer->setContentsOpaque(false); 308 m_graphicsLayer->setContentsOpaque(false);
309 } else if (m_backgroundLayer) { 309 } else if (m_backgroundLayer) {
310 m_graphicsLayer->setContentsOpaque(false); 310 m_graphicsLayer->setContentsOpaque(false);
311 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds())); 311 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds()));
312 } else { 312 } else {
313 // For non-root layers, background is painted by the scrolling contents layer if all backgrounds 313 // For non-root layers, background is painted by the scrolling contents layer if all backgrounds
(...skipping 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2694 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2695 name = "Scrolling Contents Layer"; 2695 name = "Scrolling Contents Layer";
2696 } else { 2696 } else {
2697 ASSERT_NOT_REACHED(); 2697 ASSERT_NOT_REACHED();
2698 } 2698 }
2699 2699
2700 return name; 2700 return name;
2701 } 2701 }
2702 2702
2703 } // namespace blink 2703 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698