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

Side by Side Diff: chrome/browser/ui/views/frame/browser_header_painter_ash.cc

Issue 2770943004: cros: Fix browser header wrongly drawn frame image (Closed)
Patch Set: based on suggestions Created 3 years, 9 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
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | ui/gfx/canvas.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/frame/browser_header_painter_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_header_painter_ash.h"
6 6
7 #include "ash/common/ash_layout_constants.h" 7 #include "ash/common/ash_layout_constants.h"
8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " 8 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h "
9 #include "ash/common/frame/header_painter_util.h" 9 #include "ash/common/frame/header_painter_util.h"
10 #include "ash/resources/vector_icons/vector_icons.h" 10 #include "ash/resources/vector_icons/vector_icons.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 cc::PaintFlags flags; 75 cc::PaintFlags flags;
76 flags.setBlendMode(SkBlendMode::kPlus); 76 flags.setBlendMode(SkBlendMode::kPlus);
77 flags.setAntiAlias(antialias); 77 flags.setAntiAlias(antialias);
78 78
79 if (frame_image.isNull() && frame_overlay_image.isNull()) { 79 if (frame_image.isNull() && frame_overlay_image.isNull()) {
80 flags.setColor(background_color); 80 flags.setColor(background_color);
81 canvas->DrawRect(bounds, flags); 81 canvas->DrawRect(bounds, flags);
82 } else if (frame_overlay_image.isNull()) { 82 } else if (frame_overlay_image.isNull()) {
83 flags.setAlpha(alpha); 83 flags.setAlpha(alpha);
84 canvas->DrawImageInt(frame_image, -image_inset_x, 0, flags); 84 canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(),
85 bounds.height(), &flags);
85 } else { 86 } else {
86 flags.setAlpha(alpha); 87 flags.setAlpha(alpha);
87 canvas->SaveLayerWithFlags(flags); 88 canvas->SaveLayerWithFlags(flags);
88 89
89 if (frame_image.isNull()) { 90 if (frame_image.isNull()) {
90 canvas->DrawColor(background_color); 91 canvas->DrawColor(background_color);
91 } else { 92 } else {
92 canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(), 93 canvas->TileImageInt(frame_image, image_inset_x, 0, 0, 0, bounds.width(),
93 bounds.height()); 94 bounds.height());
94 } 95 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 299 }
299 300
300 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const { 301 gfx::Rect BrowserHeaderPainterAsh::GetPaintedBounds() const {
301 return gfx::Rect(view_->width(), painted_height_); 302 return gfx::Rect(view_->width(), painted_height_);
302 } 303 }
303 304
304 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const { 305 gfx::Rect BrowserHeaderPainterAsh::GetTitleBounds() const {
305 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_, 306 return ash::HeaderPainterUtil::GetTitleBounds(window_icon_,
306 caption_button_container_, BrowserFrame::GetTitleFontList()); 307 caption_button_container_, BrowserFrame::GetTitleFontList());
307 } 308 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | ui/gfx/canvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698