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

Side by Side Diff: views/window/custom_frame_view.cc

Issue 8405002: ui/gfx: Convert Canvas::FillRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/window/custom_frame_view.h" 5 #include "views/window/custom_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 SkBitmap* right_edge = rb.GetBitmapNamed(IDR_WINDOW_RIGHT_SIDE); 338 SkBitmap* right_edge = rb.GetBitmapNamed(IDR_WINDOW_RIGHT_SIDE);
339 SkBitmap* left_edge = rb.GetBitmapNamed(IDR_WINDOW_LEFT_SIDE); 339 SkBitmap* left_edge = rb.GetBitmapNamed(IDR_WINDOW_LEFT_SIDE);
340 SkBitmap* bottom_left_corner = 340 SkBitmap* bottom_left_corner =
341 rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER); 341 rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_LEFT_CORNER);
342 SkBitmap* bottom_right_corner = 342 SkBitmap* bottom_right_corner =
343 rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER); 343 rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_RIGHT_CORNER);
344 SkBitmap* bottom_edge = rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_CENTER); 344 SkBitmap* bottom_edge = rb.GetBitmapNamed(IDR_WINDOW_BOTTOM_CENTER);
345 345
346 // Fill with the frame color first so we have a constant background for 346 // Fill with the frame color first so we have a constant background for
347 // areas not covered by the theme image. 347 // areas not covered by the theme image.
348 canvas->FillRectInt(frame_color, 0, 0, width(), frame_image->height()); 348 canvas->FillRect(frame_color,
349 gfx::Rect(0, 0, width(), frame_image->height()));
tfarina 2011/10/27 15:13:20 Peter, using gfx::Rect here is causing views_unitt
Peter Kasting 2011/10/27 19:17:29 How is it that we're somehow getting a frame_image
tfarina 2011/10/27 20:46:03 Yeah, I was going to send you the try bot urls wit
Peter Kasting 2011/10/27 20:50:34 Can you figure out how to fix this?
349 // Now fill down the sides. 350 // Now fill down the sides.
350 canvas->FillRectInt(frame_color, 0, frame_image->height(), left_edge->width(), 351 canvas->FillRect(frame_color,
351 height() - frame_image->height()); 352 gfx::Rect(0, frame_image->height(),
352 canvas->FillRectInt(frame_color, width() - right_edge->width(), 353 left_edge->width(),
353 frame_image->height(), right_edge->width(), 354 height() - frame_image->height()));
tfarina 2011/10/27 21:31:30 Hard to say. But probably I can help identify the
Peter Kasting 2011/10/27 21:49:18 Oh! I misinterpreted what you were saying was neg
354 height() - frame_image->height()); 355 canvas->FillRect(frame_color,
356 gfx::Rect(width() - right_edge->width(),
357 frame_image->height(),
358 right_edge->width(),
359 height() - frame_image->height()));
355 // Now fill the bottom area. 360 // Now fill the bottom area.
356 canvas->FillRectInt(frame_color, 361 canvas->FillRect(
357 left_edge->width(), height() - bottom_edge->height(), 362 frame_color,
358 width() - left_edge->width() - right_edge->width(), 363 gfx::Rect(left_edge->width(),
359 bottom_edge->height()); 364 height() - bottom_edge->height(),
365 width() - left_edge->width() - right_edge->width(),
366 bottom_edge->height()));
360 367
361 // Draw the theme frame. 368 // Draw the theme frame.
362 canvas->TileImageInt(*frame_image, 0, 0, width(), frame_image->height()); 369 canvas->TileImageInt(*frame_image, 0, 0, width(), frame_image->height());
363 370
364 // Top. 371 // Top.
365 canvas->DrawBitmapInt(*top_left_corner, 0, 0); 372 canvas->DrawBitmapInt(*top_left_corner, 0, 0);
366 canvas->TileImageInt(*top_edge, top_left_corner->width(), 0, 373 canvas->TileImageInt(*top_edge, top_left_corner->width(), 0,
367 width() - top_right_corner->width(), top_edge->height()); 374 width() - top_right_corner->width(), top_edge->height());
368 canvas->DrawBitmapInt(*top_right_corner, 375 canvas->DrawBitmapInt(*top_right_corner,
369 width() - top_right_corner->width(), 0); 376 width() - top_right_corner->width(), 0);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont()); 585 title_font_ = new gfx::Font(NativeWidgetWin::GetWindowTitleFont());
579 #elif defined(OS_LINUX) 586 #elif defined(OS_LINUX)
580 // TODO(ben): need to resolve what font this is. 587 // TODO(ben): need to resolve what font this is.
581 title_font_ = new gfx::Font(); 588 title_font_ = new gfx::Font();
582 #endif 589 #endif
583 initialized = true; 590 initialized = true;
584 } 591 }
585 } 592 }
586 593
587 } // namespace views 594 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698