Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "base/trace_event/trace_event_argument.h" | 10 #include "base/trace_event/trace_event_argument.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 float width) const { | 320 float width) const { |
| 321 if (!ShowDebugBorders()) | 321 if (!ShowDebugBorders()) |
| 322 return; | 322 return; |
| 323 | 323 |
| 324 gfx::Rect quad_rect(content_bounds); | 324 gfx::Rect quad_rect(content_bounds); |
| 325 gfx::Rect visible_quad_rect(quad_rect); | 325 gfx::Rect visible_quad_rect(quad_rect); |
| 326 DebugBorderDrawQuad* debug_border_quad = | 326 DebugBorderDrawQuad* debug_border_quad = |
| 327 render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); | 327 render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); |
| 328 debug_border_quad->SetNew( | 328 debug_border_quad->SetNew( |
| 329 shared_quad_state, quad_rect, visible_quad_rect, color, width); | 329 shared_quad_state, quad_rect, visible_quad_rect, color, width); |
| 330 if (contents_opaque()) { | |
| 331 // The inner fill is more transparent then the border. | |
|
vmpstr
2015/02/11 22:22:22
nit: than
Can you also elaborate on the shape of
danakj
2015/02/11 23:44:01
Done.
| |
| 332 SkColor fill_color = | |
| 333 SkColorSetA(color, static_cast<uint8_t>(SkColorGetA(color) * 0.3f)); | |
| 334 float fill_width = width * 3; | |
| 335 gfx::Rect fill_rect = quad_rect; | |
| 336 fill_rect.Inset(fill_width / 2.f, fill_width / 2.f); | |
| 337 gfx::Rect visible_fill_rect = | |
| 338 gfx::IntersectRects(visible_quad_rect, fill_rect); | |
| 339 DebugBorderDrawQuad* fill_quad = | |
| 340 render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); | |
| 341 fill_quad->SetNew(shared_quad_state, fill_rect, visible_fill_rect, | |
| 342 fill_color, fill_width); | |
| 343 } | |
| 330 } | 344 } |
| 331 | 345 |
| 332 bool LayerImpl::HasDelegatedContent() const { | 346 bool LayerImpl::HasDelegatedContent() const { |
| 333 return false; | 347 return false; |
| 334 } | 348 } |
| 335 | 349 |
| 336 bool LayerImpl::HasContributingDelegatedRenderPasses() const { | 350 bool LayerImpl::HasContributingDelegatedRenderPasses() const { |
| 337 return false; | 351 return false; |
| 338 } | 352 } |
| 339 | 353 |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1556 SetNeedsPushProperties(); | 1570 SetNeedsPushProperties(); |
| 1557 layer_tree_impl()->set_needs_update_draw_properties(); | 1571 layer_tree_impl()->set_needs_update_draw_properties(); |
| 1558 if (should_have_render_surface) { | 1572 if (should_have_render_surface) { |
| 1559 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this)); | 1573 render_surface_ = make_scoped_ptr(new RenderSurfaceImpl(this)); |
| 1560 return; | 1574 return; |
| 1561 } | 1575 } |
| 1562 render_surface_.reset(); | 1576 render_surface_.reset(); |
| 1563 } | 1577 } |
| 1564 | 1578 |
| 1565 } // namespace cc | 1579 } // namespace cc |
| OLD | NEW |