Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / cc / layers / heads_up_display_layer_impl.cc
index 51c0ed2..bb68571 100644 (file)
@@ -25,8 +25,8 @@
 #include "third_party/skia/include/core/SkPaint.h"
 #include "third_party/skia/include/core/SkTypeface.h"
 #include "third_party/skia/include/effects/SkColorMatrixFilter.h"
-#include "ui/gfx/point.h"
-#include "ui/gfx/size.h"
+#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/size.h"
 
 namespace cc {
 
@@ -78,7 +78,7 @@ HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {}
 
 scoped_ptr<LayerImpl> HeadsUpDisplayLayerImpl::CreateLayerImpl(
     LayerTreeImpl* tree_impl) {
-  return HeadsUpDisplayLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
+  return HeadsUpDisplayLayerImpl::Create(tree_impl, id());
 }
 
 void HeadsUpDisplayLayerImpl::AcquireResource(
@@ -131,7 +131,7 @@ bool HeadsUpDisplayLayerImpl::WillDraw(DrawMode draw_mode,
 
 void HeadsUpDisplayLayerImpl::AppendQuads(
     RenderPass* render_pass,
-    const OcclusionTracker<LayerImpl>& occlusion_tracker,
+    const Occlusion& occlusion_in_content_space,
     AppendQuadsData* append_quads_data) {
   if (!resources_.back()->id())
     return;
@@ -340,7 +340,7 @@ void HeadsUpDisplayLayerImpl::DrawGraphLines(SkCanvas* canvas,
                    bounds.right(),
                    bounds.top() + indicator_top,
                    *paint);
-  paint->setXfermode(NULL);
+  paint->setXfermode(nullptr);
 }
 
 SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay(
@@ -385,6 +385,8 @@ SkRect HeadsUpDisplayLayerImpl::DrawFPSDisplay(
   const std::string min_max_text =
       base::StringPrintf("%.0f-%.0f", fps_graph_.min, fps_graph_.max);
 
+  VLOG(1) << value_text;
+
   paint.setColor(DebugColors::FPSDisplayTextAndGraphColor());
   DrawText(canvas,
            &paint,
@@ -485,7 +487,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
                                                   int right,
                                                   int top,
                                                   int width) const {
-  if (!memory_entry_.bytes_total())
+  if (!memory_entry_.total_bytes_used)
     return SkRect::MakeEmpty();
 
   const int kPadding = 4;
@@ -495,7 +497,7 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
   const int left = bounds().width() - width - right;
   const SkRect area = SkRect::MakeXYWH(left, top, width, height);
 
-  const double megabyte = 1024.0 * 1024.0;
+  const double kMegabyte = 1024.0 * 1024.0;
 
   SkPaint paint = CreatePaint();
   DrawGraphBackground(canvas, &paint, area);
@@ -514,20 +516,14 @@ SkRect HeadsUpDisplayLayerImpl::DrawMemoryDisplay(SkCanvas* canvas,
            kFontHeight,
            title_pos);
 
-  std::string text =
-      base::StringPrintf("%6.1f MB used",
-                         (memory_entry_.bytes_unreleasable +
-                          memory_entry_.bytes_allocated) / megabyte);
+  std::string text = base::StringPrintf(
+      "%6.1f MB used", memory_entry_.total_bytes_used / kMegabyte);
   DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos);
 
-  if (memory_entry_.bytes_over) {
+  if (!memory_entry_.had_enough_memory)
     paint.setColor(SK_ColorRED);
-    text = base::StringPrintf("%6.1f MB over",
-                              memory_entry_.bytes_over / megabyte);
-  } else {
-    text = base::StringPrintf("%6.1f MB max ",
-                              memory_entry_.total_budget_in_bytes / megabyte);
-  }
+  text = base::StringPrintf("%6.1f MB max ",
+                            memory_entry_.total_budget_in_bytes / kMegabyte);
   DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos);
 
   return area;
@@ -571,13 +567,8 @@ SkRect HeadsUpDisplayLayerImpl::DrawPaintTimeDisplay(
       "%.1f-%.1f", paint_time_graph_.min, paint_time_graph_.max);
 
   paint.setColor(DebugColors::PaintTimeDisplayTextAndGraphColor());
-  DrawText(canvas,
-           &paint,
-           "Page paint time (ms)",
-           SkPaint::kLeft_Align,
-           kFontHeight,
-           text_bounds.left(),
-           text_bounds.bottom());
+  DrawText(canvas, &paint, "Compositor frame time (ms)", SkPaint::kLeft_Align,
+           kFontHeight, text_bounds.left(), text_bounds.bottom());
   DrawText(canvas,
            &paint,
            value_text,