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

Unified Diff: cc/layers/layer_impl.cc

Issue 917763003: cc: Move occlusion debug rects into the debug layer borders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: occlusiondebugrects: reviewed Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/render_surface_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index f74228bdacf694cca1ac36e0c2503da2ba4fc510..fd84e5814174b89720237f2f0915e5bedd5015cd 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -327,6 +327,22 @@ void LayerImpl::AppendDebugBorderQuad(RenderPass* render_pass,
render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
debug_border_quad->SetNew(
shared_quad_state, quad_rect, visible_quad_rect, color, width);
+ if (contents_opaque()) {
+ // When opaque, draw a second inner border that is thicker than the outer
+ // border, but more transparent.
+ static const float kFillOpacity = 0.3f;
+ SkColor fill_color = SkColorSetA(
+ color, static_cast<uint8_t>(SkColorGetA(color) * kFillOpacity));
+ float fill_width = width * 3;
+ gfx::Rect fill_rect = quad_rect;
+ fill_rect.Inset(fill_width / 2.f, fill_width / 2.f);
+ gfx::Rect visible_fill_rect =
+ gfx::IntersectRects(visible_quad_rect, fill_rect);
+ DebugBorderDrawQuad* fill_quad =
+ render_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
+ fill_quad->SetNew(shared_quad_state, fill_rect, visible_fill_rect,
+ fill_color, fill_width);
+ }
}
bool LayerImpl::HasDelegatedContent() const {
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.cc ('k') | cc/layers/render_surface_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698