| Index: cc/layers/heads_up_display_layer_impl.cc
|
| diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
|
| index bb6857103878ff102e646f40b74d8e4640bc3c34..ea9e713bf24646d461004bae954b128cd4bf3a75 100644
|
| --- a/cc/layers/heads_up_display_layer_impl.cc
|
| +++ b/cc/layers/heads_up_display_layer_impl.cc
|
| @@ -17,6 +17,7 @@
|
| #include "cc/output/renderer.h"
|
| #include "cc/quads/texture_draw_quad.h"
|
| #include "cc/resources/memory_history.h"
|
| +#include "cc/trees/layer_tree_host_impl.h"
|
| #include "cc/trees/layer_tree_impl.h"
|
| #include "skia/ext/platform_canvas.h"
|
| #include "third_party/khronos/GLES2/gl2.h"
|
| @@ -276,6 +277,9 @@ void HeadsUpDisplayLayerImpl::DrawHudContents(SkCanvas* canvas) {
|
| DrawFPSDisplay(canvas, layer_tree_impl()->frame_rate_counter(), 0, 0);
|
| }
|
|
|
| + area = DrawGpuRasterizationStatus(canvas, 0, area.bottom(),
|
| + SkMaxScalar(area.width(), 150));
|
| +
|
| if (debug_state.ShowMemoryStats())
|
| DrawMemoryDisplay(canvas, 0, area.bottom(), SkMaxScalar(area.width(), 150));
|
| }
|
| @@ -529,6 +533,57 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
|
| return area;
|
| }
|
|
|
| +SkRect HeadsUpDisplayLayerImpl::DrawGpuRasterizationStatus(SkCanvas* canvas,
|
| + int right,
|
| + int top,
|
| + int width) const {
|
| + std::string status;
|
| + SkColor color = SK_ColorRED;
|
| + switch (layer_tree_impl()->GetGpuRasterizationStatus()) {
|
| + case GpuRasterizationStatus::ON:
|
| + status = "GPU raster: on";
|
| + color = SK_ColorGREEN;
|
| + break;
|
| + case GpuRasterizationStatus::ON_FORCED:
|
| + status = "GPU raster: on (forced)";
|
| + color = SK_ColorGREEN;
|
| + break;
|
| + case GpuRasterizationStatus::OFF_DEVICE:
|
| + status = "GPU raster: off (device)";
|
| + color = SK_ColorRED;
|
| + break;
|
| + case GpuRasterizationStatus::OFF_VIEWPORT:
|
| + status = "GPU raster: off (viewport)";
|
| + color = SK_ColorYELLOW;
|
| + break;
|
| + case GpuRasterizationStatus::OFF_CONTENT:
|
| + status = "GPU raster: off (content)";
|
| + color = SK_ColorYELLOW;
|
| + break;
|
| + }
|
| +
|
| + if (status.empty())
|
| + return SkRect::MakeEmpty();
|
| +
|
| + const int kPadding = 4;
|
| + const int kFontHeight = 13;
|
| +
|
| + const int height = kFontHeight + 2 * kPadding;
|
| + const int left = bounds().width() - width - right;
|
| + const SkRect area = SkRect::MakeXYWH(left, top, width, height);
|
| +
|
| + SkPaint paint = CreatePaint();
|
| + DrawGraphBackground(canvas, &paint, area);
|
| +
|
| + SkPoint gpu_status_pos = SkPoint::Make(left + kPadding, top + kFontHeight);
|
| +
|
| + paint.setColor(color);
|
| + DrawText(canvas, &paint, status, SkPaint::kLeft_Align, kFontHeight,
|
| + gpu_status_pos);
|
| +
|
| + return area;
|
| +}
|
| +
|
| SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay(
|
| SkCanvas* canvas,
|
| const PaintTimeCounter* paint_time_counter,
|
|
|