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

Side by Side Diff: ui/compositor/layer.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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
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/compositor/layer.h" 5 #include "ui/compositor/layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 !iter.done(); iter.next()) { 456 !iter.done(); iter.next()) {
457 const SkIRect& sk_damaged = iter.rect(); 457 const SkIRect& sk_damaged = iter.rect();
458 gfx::Rect damaged( 458 gfx::Rect damaged(
459 sk_damaged.x(), 459 sk_damaged.x(),
460 sk_damaged.y(), 460 sk_damaged.y(),
461 sk_damaged.width(), 461 sk_damaged.width(),
462 sk_damaged.height()); 462 sk_damaged.height());
463 463
464 if (scale_content_ && web_layer_is_accelerated_) { 464 if (scale_content_ && web_layer_is_accelerated_) {
465 damaged.Inset(-1, -1); 465 damaged.Inset(-1, -1);
466 damaged = damaged.Intersect(gfx::Rect(bounds_.size())); 466 damaged.Intersect(gfx::Rect(bounds_.size()));
467 } 467 }
468 468
469 gfx::Rect damaged_in_pixel = ConvertRectToPixel(this, damaged); 469 gfx::Rect damaged_in_pixel = ConvertRectToPixel(this, damaged);
470 WebKit::WebFloatRect web_rect( 470 WebKit::WebFloatRect web_rect(
471 damaged_in_pixel.x(), 471 damaged_in_pixel.x(),
472 damaged_in_pixel.y(), 472 damaged_in_pixel.y(),
473 damaged_in_pixel.width(), 473 damaged_in_pixel.width(),
474 damaged_in_pixel.height()); 474 damaged_in_pixel.height());
475 web_layer_->invalidateRect(web_rect); 475 web_layer_->invalidateRect(web_rect);
476 } 476 }
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 return; 778 return;
779 unsigned int color = 0xFF000000; 779 unsigned int color = 0xFF000000;
780 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; 780 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000;
781 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); 781 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f);
782 if (!opaque) 782 if (!opaque)
783 color |= 0xFF; 783 color |= 0xFF;
784 web_layer_->setDebugBorderColor(color); 784 web_layer_->setDebugBorderColor(color);
785 } 785 }
786 786
787 } // namespace ui 787 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/win/hwnd_util.cc ('k') | ui/gfx/blit.cc » ('j') | ui/gfx/rect_base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698