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

Side by Side Diff: ui/views/bubble/bubble_border.cc

Issue 2363403003: Harmony - fix border for OIB. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | ui/views/bubble/bubble_dialog_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/bubble/bubble_border.h" 5 #include "ui/views/bubble/bubble_border.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "third_party/skia/include/core/SkDrawLooper.h" 10 #include "third_party/skia/include/core/SkDrawLooper.h"
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 // Fill the contents with a round-rect region to match the border images. 501 // Fill the contents with a round-rect region to match the border images.
502 SkPaint paint; 502 SkPaint paint;
503 paint.setAntiAlias(true); 503 paint.setAntiAlias(true);
504 paint.setStyle(SkPaint::kFill_Style); 504 paint.setStyle(SkPaint::kFill_Style);
505 paint.setColor(border_->background_color()); 505 paint.setColor(border_->background_color());
506 SkPath path; 506 SkPath path;
507 gfx::RectF bounds(view->GetLocalBounds()); 507 gfx::RectF bounds(view->GetLocalBounds());
508 bounds.Inset(gfx::InsetsF(border_->GetInsets())); 508 bounds.Inset(gfx::InsetsF(border_->GetInsets()));
509 if (UseMd()) { 509 if (UseMd()) {
510 // The border is 1px at all scale factors. Leave room for it. 510 // The border is 1px at all scale factors. Leave room for it. It's partially
511 // transparent, so we don't want to draw any background underneath it.
511 const SkScalar one_pixel = SkFloatToScalar(1 / canvas->image_scale()); 512 const SkScalar one_pixel = SkFloatToScalar(1 / canvas->image_scale());
512 bounds.Inset(gfx::InsetsF(one_pixel)); 513 bounds.Inset(gfx::InsetsF(one_pixel));
513 } 514 }
514 515
515 canvas->DrawRoundRect(bounds, border_->GetBorderCornerRadius(), paint); 516 canvas->DrawRoundRect(bounds, border_->GetBorderCornerRadius(), paint);
516 } 517 }
517 518
518 } // namespace views 519 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/bubble/bubble_dialog_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698