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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 11058003: No need to kClear_Mode a layer right after its created, as that will automatically (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/defaults.h" 10 #include "chrome/browser/defaults.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } else { 583 } else {
584 if (mini_title_animation_.get() && mini_title_animation_->is_animating()) 584 if (mini_title_animation_.get() && mini_title_animation_->is_animating())
585 PaintInactiveTabBackgroundWithTitleChange(canvas); 585 PaintInactiveTabBackgroundWithTitleChange(canvas);
586 else 586 else
587 PaintInactiveTabBackground(canvas); 587 PaintInactiveTabBackground(canvas);
588 588
589 double throb_value = GetThrobValue(); 589 double throb_value = GetThrobValue();
590 if (throb_value > 0) { 590 if (throb_value > 0) {
591 canvas->SaveLayerAlpha(static_cast<int>(throb_value * 0xff), 591 canvas->SaveLayerAlpha(static_cast<int>(throb_value * 0xff),
592 gfx::Rect(width(), height())); 592 gfx::Rect(width(), height()));
593 canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
594 PaintActiveTabBackground(canvas, GetTabBackgroundImage(data().mode)); 593 PaintActiveTabBackground(canvas, GetTabBackgroundImage(data().mode));
595 canvas->Restore(); 594 canvas->Restore();
596 } 595 }
597 } 596 }
598 } 597 }
599 598
600 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) { 599 void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
601 // Render the inactive tab background. We'll use this for clipping. 600 // Render the inactive tab background. We'll use this for clipping.
602 gfx::Canvas background_canvas(size(), canvas->scale_factor(), false); 601 gfx::Canvas background_canvas(size(), canvas->scale_factor(), false);
603 PaintInactiveTabBackground(&background_canvas); 602 PaintInactiveTabBackground(&background_canvas);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 const gfx::ImageSkia& image) { 913 const gfx::ImageSkia& image) {
915 ImageCacheEntry entry; 914 ImageCacheEntry entry;
916 entry.resource_id = resource_id; 915 entry.resource_id = resource_id;
917 entry.scale_factor = scale_factor; 916 entry.scale_factor = scale_factor;
918 entry.image = image; 917 entry.image = image;
919 entry.instant_images = instant_images; 918 entry.instant_images = instant_images;
920 image_cache_->push_front(entry); 919 image_cache_->push_front(entry);
921 if (image_cache_->size() > kMaxImageCacheSize) 920 if (image_cache_->size() > kMaxImageCacheSize)
922 image_cache_->pop_back(); 921 image_cache_->pop_back();
923 } 922 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/translate_infobar_base.cc ('k') | ui/views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698