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

Side by Side Diff: Source/core/platform/graphics/chromium/GraphicsLayerChromium.cpp

Issue 14407003: Disable solid background color optimization for composited layers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 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
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2009 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // The old contents layer will be removed via updateChildList. 505 // The old contents layer will be removed via updateChildList.
506 m_contentsLayer = 0; 506 m_contentsLayer = 0;
507 } 507 }
508 508
509 if (childrenChanged) 509 if (childrenChanged)
510 updateChildList(); 510 updateChildList();
511 } 511 }
512 512
513 void GraphicsLayerChromium::setContentsToSolidColor(const Color& color) 513 void GraphicsLayerChromium::setContentsToSolidColor(const Color& color)
514 { 514 {
515 if (color == m_contentsSolidColor)
516 return;
517
518 bool childrenChanged = false;
519
520 m_contentsSolidColor = color;
521
522 if (color.isValid() && color.alpha()) {
523 if (!m_contentsSolidColorLayer) {
524 m_contentsSolidColorLayer = adoptPtr(Platform::current()->compositor Support()->createSolidColorLayer());
525 registerContentsLayer(m_contentsSolidColorLayer->layer());
526
527 setupContentsLayer(m_contentsSolidColorLayer->layer());
528 childrenChanged = true;
529 }
530
531 m_contentsSolidColorLayer->setBackgroundColor(color.rgb());
532 updateContentsRect();
533 } else {
534 if (m_contentsSolidColorLayer) {
535 childrenChanged = true;
536 unregisterContentsLayer(m_contentsSolidColorLayer->layer());
537 m_contentsSolidColorLayer.clear();
538 }
539 m_contentsLayer = 0;
540 }
541
542 if (childrenChanged)
543 updateChildList();
544
545 } 515 }
546 516
547 static HashSet<int>* s_registeredLayerSet; 517 static HashSet<int>* s_registeredLayerSet;
548 518
549 void GraphicsLayerChromium::registerContentsLayer(WebLayer* layer) 519 void GraphicsLayerChromium::registerContentsLayer(WebLayer* layer)
550 { 520 {
551 if (!s_registeredLayerSet) 521 if (!s_registeredLayerSet)
552 s_registeredLayerSet = new HashSet<int>; 522 s_registeredLayerSet = new HashSet<int>;
553 if (s_registeredLayerSet->contains(layer->id())) 523 if (s_registeredLayerSet->contains(layer->id()))
554 CRASH(); 524 CRASH();
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 info.addMember(m_transformLayer, "transformLayer"); 872 info.addMember(m_transformLayer, "transformLayer");
903 info.addMember(m_imageLayer, "imageLayer"); 873 info.addMember(m_imageLayer, "imageLayer");
904 info.addMember(m_contentsLayer, "contentsLayer"); 874 info.addMember(m_contentsLayer, "contentsLayer");
905 info.addMember(m_linkHighlight, "linkHighlight"); 875 info.addMember(m_linkHighlight, "linkHighlight");
906 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking ContentLayerDelegate"); 876 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking ContentLayerDelegate");
907 info.addMember(m_animationIdMap, "animationIdMap"); 877 info.addMember(m_animationIdMap, "animationIdMap");
908 info.addMember(m_scrollableArea, "scrollableArea"); 878 info.addMember(m_scrollableArea, "scrollableArea");
909 } 879 }
910 880
911 } // namespace WebCore 881 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698