Exemplo n.º 1
0
static void LeaveEntry(struct Control* control, int top, int index)
{
  struct VerticalScrollControl* VBox = 
                    (struct VerticalScrollControl*) control->ControlData;
  struct LowListBox* LBox = (struct LowListBox*) VBox->ControlData;
  struct DriveSelectionBox* box = 
                               (struct DriveSelectionBox*) LBox->ControlData;

  DrawEntry(control->posx+1,
            control->posy+index-top+1, 
            box->Drives[index],
            VBox->xlen-2,
            control->backcolor, VBox->BorderBackC, VBox->BorderBackC);
}
Exemplo n.º 2
0
static void SelectEntry(struct Control* control, int top, int index)
{
  struct VerticalScrollControl* VBox = 
                    (struct VerticalScrollControl*) control->ControlData;
  struct LowListBox* LBox = (struct LowListBox*) VBox->ControlData;
  struct DriveSelectionBox* box = 
                               (struct DriveSelectionBox*) LBox->ControlData;

  DrawEntry(control->posx+1,
            control->posy+index-top+1, 
            box->Drives[index],
            VBox->xlen-2,
            box->HighColor, VBox->BorderBackC, VBox->BorderBackC);

  VBox->AdjustScrollBar(control, index, AmOfEntries(control));
}
Exemplo n.º 3
0
bool
fastuidraw::gl::detail::PainterBackendGL::DrawCommand::
draw_break(enum PainterSurface::render_type_t render_type,
           const PainterShaderGroup &old_shaders,
           const PainterShaderGroup &new_shaders,
           unsigned int indices_written)
{
  /* if the blend mode changes, then we need to start a new DrawEntry */
  BlendMode old_mode, new_mode;
  uint32_t new_disc, old_disc;
  bool return_value(false);
  enum PainterBlendShader::shader_type old_blend_type, new_blend_type;

  old_mode = old_shaders.blend_mode();
  new_mode = new_shaders.blend_mode();

  old_blend_type = old_shaders.blend_shader_type();
  new_blend_type = new_shaders.blend_shader_type();

  if (m_pr->use_uber_shader())
    {
      old_disc = old_shaders.item_group() & PainterShaderRegistrarGL::shader_group_discard_mask;
      new_disc = new_shaders.item_group() & PainterShaderRegistrarGL::shader_group_discard_mask;
    }
  else
    {
      old_disc = old_shaders.item_group();
      new_disc = new_shaders.item_group();
    }

  if (old_disc != new_disc || old_blend_type != new_blend_type)
    {
      Program *new_program;
      if (m_pr->use_uber_shader())
        {
          if (render_type == PainterSurface::color_buffer_type)
            {
              enum PainterEngineGL::program_type_t pz;
              pz = m_pr->m_choose_uber_program[new_disc != 0u];
              new_program = m_pr->m_cached_programs.program(pz, new_blend_type).get();
            }
          else
            {
              new_program = m_pr->m_cached_programs.m_deferred_coverage_program.get();
            }
        }
      else
        {
          new_program =
            m_pr->m_cached_item_programs->program_of_item_shader(render_type, new_disc, new_blend_type).get();
        }

      if (!m_draws.empty())
        {
          add_entry(indices_written);
          return_value = true;
        }

      FASTUIDRAWassert(new_program);
      m_draws.push_back(DrawEntry(fastuidraw::BlendMode(new_mode), new_program, new_blend_type));
      return return_value;
    }
  else if (old_mode != new_mode)
    {
      if (!m_draws.empty())
        {
          add_entry(indices_written);
          return_value = true;
        }
      m_draws.push_back(new_mode);
      return return_value;
    }
  else
    {
      /* any other state changes means that we just need to add an
       * entry to the current draw entry.
       */
      add_entry(indices_written);
      return false;
    }
}