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

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: fix build + feedback Created 4 years, 4 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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 m_graphicsLayer->setIsRootForIsolatedGroup(isolate); 293 m_graphicsLayer->setIsRootForIsolatedGroup(isolate);
294 } 294 }
295 295
296 void CompositedLayerMapping::updateContentsOpaque() 296 void CompositedLayerMapping::updateContentsOpaque()
297 { 297 {
298 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer); 298 ASSERT(m_isMainFrameLayoutViewLayer || !m_backgroundLayer);
299 if (isAcceleratedCanvas(layoutObject())) { 299 if (isAcceleratedCanvas(layoutObject())) {
300 // Determine whether the rendering context's external texture layer is o paque. 300 // Determine whether the rendering context's external texture layer is o paque.
301 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext(); 301 CanvasRenderingContext* context = toHTMLCanvasElement(layoutObject()->no de())->renderingContext();
302 if (!context->hasAlpha()) 302 if (!context->creationAttributes().alpha())
303 m_graphicsLayer->setContentsOpaque(true); 303 m_graphicsLayer->setContentsOpaque(true);
304 else if (WebLayer* layer = context->platformLayer()) 304 else if (WebLayer* layer = context->platformLayer())
305 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha()); 305 m_graphicsLayer->setContentsOpaque(!Color(layer->backgroundColor()). hasAlpha());
306 else 306 else
307 m_graphicsLayer->setContentsOpaque(false); 307 m_graphicsLayer->setContentsOpaque(false);
308 } else if (m_backgroundLayer) { 308 } else if (m_backgroundLayer) {
309 m_graphicsLayer->setContentsOpaque(false); 309 m_graphicsLayer->setContentsOpaque(false);
310 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds())); 310 m_backgroundLayer->setContentsOpaque(m_owningLayer.backgroundIsKnownToBe OpaqueInRect(compositedBounds()));
311 } else { 311 } else {
312 // For non-root layers, background is painted by the scrolling contents layer if all backgrounds 312 // For non-root layers, background is painted by the scrolling contents layer if all backgrounds
(...skipping 2396 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2709 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2710 name = "Scrolling Contents Layer"; 2710 name = "Scrolling Contents Layer";
2711 } else { 2711 } else {
2712 ASSERT_NOT_REACHED(); 2712 ASSERT_NOT_REACHED();
2713 } 2713 }
2714 2714
2715 return name; 2715 return name;
2716 } 2716 }
2717 2717
2718 } // namespace blink 2718 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698