Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "ui/gfx/compositor/layer.h" | 5 #include "ui/gfx/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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 if (!texture_.get()) | 317 if (!texture_.get()) |
| 318 texture_ = GetCompositor()->CreateTexture(); | 318 texture_ = GetCompositor()->CreateTexture(); |
| 319 | 319 |
| 320 texture_->SetCanvas(canvas, origin, bounds_.size()); | 320 texture_->SetCanvas(canvas, origin, bounds_.size()); |
| 321 invalid_rect_ = gfx::Rect(); | 321 invalid_rect_ = gfx::Rect(); |
| 322 #endif | 322 #endif |
| 323 } | 323 } |
| 324 | 324 |
| 325 void Layer::SchedulePaint(const gfx::Rect& invalid_rect) { | 325 void Layer::SchedulePaint(const gfx::Rect& invalid_rect) { |
| 326 #if defined(USE_WEBKIT_COMPOSITOR) | 326 #if defined(USE_WEBKIT_COMPOSITOR) |
| 327 WebKit::WebFloatRect web_rect(invalid_rect.x(), | 327 WebKit::WebFloatRect web_rect( |
| 328 invalid_rect.x(), | |
| 328 invalid_rect.y(), | 329 invalid_rect.y(), |
| 329 invalid_rect.width(), | 330 invalid_rect.width(), |
| 330 invalid_rect.height()); | 331 invalid_rect.height()); |
| 331 if (!web_layer_is_accelerated_) | 332 if (!web_layer_is_accelerated_) |
| 332 web_layer_.to<WebKit::WebContentLayer>().invalidateRect(web_rect); | 333 web_layer_.to<WebKit::WebContentLayer>().invalidateRect(web_rect); |
| 334 else | |
|
apatrick_chromium
2011/12/06 01:10:30
nit: According to chrome style, this if-else wants
jonathan.backer
2011/12/06 17:42:33
Done.
| |
| 335 web_layer_.to<WebKit::WebExternalTextureLayer>(). | |
| 336 setNeedsDisplayRect(web_rect); | |
| 333 #else | 337 #else |
| 334 invalid_rect_ = invalid_rect_.Union(invalid_rect); | 338 invalid_rect_ = invalid_rect_.Union(invalid_rect); |
| 335 ScheduleDraw(); | 339 ScheduleDraw(); |
| 336 #endif | 340 #endif |
| 337 } | 341 } |
| 338 | 342 |
| 339 void Layer::ScheduleDraw() { | 343 void Layer::ScheduleDraw() { |
| 340 Compositor* compositor = GetCompositor(); | 344 Compositor* compositor = GetCompositor(); |
| 341 if (compositor) | 345 if (compositor) |
| 342 compositor->ScheduleDraw(); | 346 compositor->ScheduleDraw(); |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 unsigned int color = 0xFF000000; | 765 unsigned int color = 0xFF000000; |
| 762 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; | 766 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; |
| 763 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); | 767 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); |
| 764 if (!opaque) | 768 if (!opaque) |
| 765 color |= 0xFF; | 769 color |= 0xFF; |
| 766 web_layer_.setDebugBorderColor(color); | 770 web_layer_.setDebugBorderColor(color); |
| 767 } | 771 } |
| 768 #endif | 772 #endif |
| 769 | 773 |
| 770 } // namespace ui | 774 } // namespace ui |
| OLD | NEW |