OLD | NEW |
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 RecomputeDrawsContentAndUVRect(); | 415 RecomputeDrawsContentAndUVRect(); |
416 SchedulePaint(gfx::Rect(bounds_.size())); | 416 SchedulePaint(gfx::Rect(bounds_.size())); |
417 if (delegate_) | 417 if (delegate_) |
418 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); | 418 delegate_->OnDeviceScaleFactorChanged(device_scale_factor); |
419 for (size_t i = 0; i < children_.size(); ++i) | 419 for (size_t i = 0; i < children_.size(); ++i) |
420 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); | 420 children_[i]->OnDeviceScaleFactorChanged(device_scale_factor); |
421 } | 421 } |
422 | 422 |
423 void Layer::paintContents(WebKit::WebCanvas* web_canvas, | 423 void Layer::paintContents(WebKit::WebCanvas* web_canvas, |
424 const WebKit::WebRect& clip, | 424 const WebKit::WebRect& clip, |
| 425 #if defined(WEBCONTENTLAYERCLIENT_FLOAT_OPAQUE_RECT) |
| 426 WebKit::WebFloatRect& opaque) { |
| 427 #else |
425 WebKit::WebRect& opaque) { | 428 WebKit::WebRect& opaque) { |
| 429 #endif |
426 TRACE_EVENT0("ui", "Layer::paintContents"); | 430 TRACE_EVENT0("ui", "Layer::paintContents"); |
427 gfx::Canvas canvas(web_canvas, | 431 gfx::Canvas canvas(web_canvas, |
428 ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_); | 432 ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_); |
429 | 433 |
430 if (delegate_) | 434 if (delegate_) |
431 delegate_->OnPaintLayer(&canvas); | 435 delegate_->OnPaintLayer(&canvas); |
432 } | 436 } |
433 | 437 |
434 void Layer::SetForceRenderSurface(bool force) { | 438 void Layer::SetForceRenderSurface(bool force) { |
435 if (force_render_surface_ == force) | 439 if (force_render_surface_ == force) |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 return; | 664 return; |
661 unsigned int color = 0xFF000000; | 665 unsigned int color = 0xFF000000; |
662 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; | 666 color |= web_layer_is_accelerated_ ? 0x0000FF00 : 0x00FF0000; |
663 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); | 667 bool opaque = fills_bounds_opaquely_ && (GetCombinedOpacity() == 1.f); |
664 if (!opaque) | 668 if (!opaque) |
665 color |= 0xFF; | 669 color |= 0xFF; |
666 web_layer_.setDebugBorderColor(color); | 670 web_layer_.setDebugBorderColor(color); |
667 } | 671 } |
668 | 672 |
669 } // namespace ui | 673 } // namespace ui |
OLD | NEW |