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

Side by Side Diff: chromium/GraphicsLayerChromium.cpp

Issue 14333021: Merge 148856 "Disable solid background color optimization for composited layers." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1453/Source/WebCore/platform/graphics/
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 | « 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 // The old contents layer will be removed via updateChildList. 510 // The old contents layer will be removed via updateChildList.
511 m_contentsLayer = 0; 511 m_contentsLayer = 0;
512 } 512 }
513 513
514 if (childrenChanged) 514 if (childrenChanged)
515 updateChildList(); 515 updateChildList();
516 } 516 }
517 517
518 void GraphicsLayerChromium::setContentsToSolidColor(const Color& color) 518 void GraphicsLayerChromium::setContentsToSolidColor(const Color& color)
519 { 519 {
520 if (color == m_contentsSolidColor)
521 return;
522
523 bool childrenChanged = false;
524
525 m_contentsSolidColor = color;
526
527 if (color.isValid() && color.alpha()) {
528 if (!m_contentsSolidColorLayer) {
529 m_contentsSolidColorLayer = adoptPtr(Platform::current()->compositor Support()->createSolidColorLayer());
530 registerContentsLayer(m_contentsSolidColorLayer->layer());
531
532 setupContentsLayer(m_contentsSolidColorLayer->layer());
533 childrenChanged = true;
534 }
535
536 m_contentsSolidColorLayer->setBackgroundColor(color.rgb());
537 updateContentsRect();
538 } else {
539 if (m_contentsSolidColorLayer) {
540 childrenChanged = true;
541 unregisterContentsLayer(m_contentsSolidColorLayer->layer());
542 m_contentsSolidColorLayer.clear();
543 }
544 m_contentsLayer = 0;
545 }
546
547 if (childrenChanged)
548 updateChildList();
549
550 } 520 }
551 521
552 static HashSet<int>* s_registeredLayerSet; 522 static HashSet<int>* s_registeredLayerSet;
553 523
554 void GraphicsLayerChromium::registerContentsLayer(WebLayer* layer) 524 void GraphicsLayerChromium::registerContentsLayer(WebLayer* layer)
555 { 525 {
556 if (!s_registeredLayerSet) 526 if (!s_registeredLayerSet)
557 s_registeredLayerSet = new HashSet<int>; 527 s_registeredLayerSet = new HashSet<int>;
558 if (s_registeredLayerSet->contains(layer->id())) 528 if (s_registeredLayerSet->contains(layer->id()))
559 CRASH(); 529 CRASH();
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 info.addMember(m_contentsLayer, "contentsLayer"); 879 info.addMember(m_contentsLayer, "contentsLayer");
910 info.addMember(m_linkHighlight, "linkHighlight"); 880 info.addMember(m_linkHighlight, "linkHighlight");
911 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking ContentLayerDelegate"); 881 info.addMember(m_opaqueRectTrackingContentLayerDelegate, "opaqueRectTracking ContentLayerDelegate");
912 info.addMember(m_animationIdMap, "animationIdMap"); 882 info.addMember(m_animationIdMap, "animationIdMap");
913 info.addMember(m_scrollableArea, "scrollableArea"); 883 info.addMember(m_scrollableArea, "scrollableArea");
914 } 884 }
915 885
916 } // namespace WebCore 886 } // namespace WebCore
917 887
918 #endif // USE(ACCELERATED_COMPOSITING) 888 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« no previous file with comments | « GraphicsLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698