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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11377122: cc: Visualize non-occluding rects in composited layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « cc/debug_rect_history.cc ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/heads_up_display_layer_impl.h" 5 #include "cc/heads_up_display_layer_impl.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "cc/debug_rect_history.h" 8 #include "cc/debug_rect_history.h"
9 #include "cc/font_atlas.h" 9 #include "cc/font_atlas.h"
10 #include "cc/frame_rate_counter.h" 10 #include "cc/frame_rate_counter.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 // Screen space rects in green. 294 // Screen space rects in green.
295 strokeColor = SkColorSetARGB(255, 100, 200, 0); 295 strokeColor = SkColorSetARGB(255, 100, 200, 0);
296 fillColor = SkColorSetARGB(30, 100, 200, 0); 296 fillColor = SkColorSetARGB(30, 100, 200, 0);
297 break; 297 break;
298 case ScreenSpaceRectType: 298 case ScreenSpaceRectType:
299 // Screen space rects in purple. 299 // Screen space rects in purple.
300 strokeColor = SkColorSetARGB(255, 100, 0, 200); 300 strokeColor = SkColorSetARGB(255, 100, 0, 200);
301 fillColor = SkColorSetARGB(10, 100, 0, 200); 301 fillColor = SkColorSetARGB(10, 100, 0, 200);
302 break; 302 break;
303 case OccludingRectType: 303 case OccludingRectType:
304 // Occluding rects in a reddish color. 304 // Occluding rects in pink.
305 strokeColor = SkColorSetARGB(255, 245, 136, 255);
306 fillColor = SkColorSetARGB(10, 245, 136, 255);
307 break;
308 case NonOccludingRectType:
309 // Non-Occluding rects in a reddish color.
305 strokeColor = SkColorSetARGB(255, 200, 0, 100); 310 strokeColor = SkColorSetARGB(255, 200, 0, 100);
306 fillColor = SkColorSetARGB(10, 200, 0, 100); 311 fillColor = SkColorSetARGB(10, 200, 0, 100);
307 break; 312 break;
308 } 313 }
309 314
310 const gfx::RectF& rect = debugRects[i].rect; 315 const gfx::RectF& rect = debugRects[i].rect;
311 SkRect skRect = SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect. height()); 316 SkRect skRect = SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect. height());
312 SkPaint paint = createPaint(); 317 SkPaint paint = createPaint();
313 paint.setColor(fillColor); 318 paint.setColor(fillColor);
314 canvas->drawRect(skRect, paint); 319 canvas->drawRect(skRect, paint);
315 320
316 paint.setColor(strokeColor); 321 paint.setColor(strokeColor);
317 paint.setStyle(SkPaint::kStroke_Style); 322 paint.setStyle(SkPaint::kStroke_Style);
318 paint.setStrokeWidth(2); 323 paint.setStrokeWidth(2);
319 canvas->drawRect(skRect, paint); 324 canvas->drawRect(skRect, paint);
320 } 325 }
321 } 326 }
322 327
323 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const 328 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const
324 { 329 {
325 return "HeadsUpDisplayLayer"; 330 return "HeadsUpDisplayLayer";
326 } 331 }
327 332
328 } // namespace cc 333 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug_rect_history.cc ('k') | cc/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698