<commit_before>// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "CaptureViewElement.h"

#include "TimeGraph.h"
#include "Viewport.h"

namespace orbit_gl {

CaptureViewElement::CaptureViewElement(CaptureViewElement* parent, TimeGraph* time_graph,
                                       orbit_gl::Viewport* viewport, TimeGraphLayout* layout)
    : viewport_(viewport), layout_(layout), time_graph_(time_graph), parent_(parent) {
  CHECK(layout != nullptr);
}

void CaptureViewElement::Draw(Batcher& batcher, TextRenderer& text_renderer,
                              const DrawContext& draw_context) {
  DoDraw(batcher, text_renderer, draw_context);

  const DrawContext inner_draw_context = draw_context.IncreasedIndentationLevel();
  for (CaptureViewElement* child : GetChildren()) {
    if (child->ShouldBeRendered()) {
      child->Draw(batcher, text_renderer, inner_draw_context);
    }
  }
}

void CaptureViewElement::UpdatePrimitives(Batcher* batcher, uint64_t min_tick, uint64_t max_tick,
                                          PickingMode picking_mode, float z_offset) {
  DoUpdatePrimitives(batcher, min_tick, max_tick, picking_mode, z_offset);
  for (CaptureViewElement* child : GetChildren()) {
    if (child->ShouldBeRendered()) {
      child->UpdatePrimitives(batcher, min_tick, max_tick, picking_mode, z_offset);
    }
  }
}

void CaptureViewElement::UpdateLayout() {
  for (CaptureViewElement* child : GetChildren()) {
    child->UpdateLayout();
  }
  DoUpdateLayout();
}<commit_msg>Introduce manual instrumentation scopes to UpdatePrimitives (#2896)<commit_after>// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "CaptureViewElement.h"

#include "TimeGraph.h"
#include "Viewport.h"

namespace orbit_gl {

CaptureViewElement::CaptureViewElement(CaptureViewElement* parent, TimeGraph* time_graph,
                                       orbit_gl::Viewport* viewport, TimeGraphLayout* layout)
    : viewport_(viewport), layout_(layout), time_graph_(time_graph), parent_(parent) {
  CHECK(layout != nullptr);
}

void CaptureViewElement::Draw(Batcher& batcher, TextRenderer& text_renderer,
                              const DrawContext& draw_context) {
  ORBIT_SCOPE_FUNCTION;

  DoDraw(batcher, text_renderer, draw_context);

  const DrawContext inner_draw_context = draw_context.IncreasedIndentationLevel();
  for (CaptureViewElement* child : GetChildren()) {
    if (child->ShouldBeRendered()) {
      child->Draw(batcher, text_renderer, inner_draw_context);
    }
  }
}

void CaptureViewElement::UpdatePrimitives(Batcher* batcher, uint64_t min_tick, uint64_t max_tick,
                                          PickingMode picking_mode, float z_offset) {
  ORBIT_SCOPE_FUNCTION;

  DoUpdatePrimitives(batcher, min_tick, max_tick, picking_mode, z_offset);
  for (CaptureViewElement* child : GetChildren()) {
    if (child->ShouldBeRendered()) {
      child->UpdatePrimitives(batcher, min_tick, max_tick, picking_mode, z_offset);
    }
  }
}

void CaptureViewElement::UpdateLayout() {
  for (CaptureViewElement* child : GetChildren()) {
    child->UpdateLayout();
  }
  DoUpdateLayout();
}
{'fraction_non_alphanumeric': 0.10214413341274568, 'fraction_numerical': 0.005955926146515783, 'mean_word_length': 3.9469808541973492, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5089338', 'n_tokens_mistral': 1006, 'n_tokens_neox': 976, 'n_words': 228}