Get the first paint time.
174499
function() {
      // Try the standardized paint timing api
      try {
        var entries = performance.getEntriesByType('paint');
        for (var i = 0; i < entries.length; i++) {
          if (entries[i]['name'] == 'first-paint') {
            navStart = performance.getEntriesByType("navigation")[0].startTime;
            firstPaint = entries[i].startTime - navStart;
            break;
          }
        }
      } catch(e) {
      }
      // If the browser supports a first paint event, just use what the browser reports
      if (firstPaint === undefined && 'msFirstPaint' in win.performance.timing)
        firstPaint = win.performance.timing.msFirstPaint - navStart;
      // For browsers that don't support first-paint or where we get insane values,
      // use the time of the last non-async script or css from the head.
      if (firstPaint === undefined || firstPaint < 0 || firstPaint > 120000) {
        firstPaint = win.performance.timing.responseStart - navStart;
        var headURLs = {};
        var headElements = doc.getElementsByTagName('head')[0].children;
        for (var i = 0; i < headElements.length; i++) {
          var el = headElements[i];
          if (el.tagName == 'SCRIPT' && el.src && !el.async)
            headURLs[el.src] = true;
          if (el.tagName == 'LINK' && el.rel == 'stylesheet' && el.href)
            headURLs[el.href] = true;
        }
        var requests = win.performance.getEntriesByType("resource");
        var doneCritical = false;
        for (var j = 0; j < requests.length; j++) {
          if (!doneCritical &&
              headURLs[requests[j].name] &&
             (requests[j].initiatorType == 'script' || requests[j].initiatorType == 'link')) {
            var requestEnd = requests[j].responseEnd;
            if (firstPaint === undefined || requestEnd > firstPaint)
              firstPaint = requestEnd;
          } else {
            doneCritical = true;
          }
        }
      }
      firstPaint = Math.max(firstPaint, 0);
    }
367970
public int first() {
    assertNonEmpty();
    short firstKey = keys[0];
    Container container = values[0];
    return firstKey << 16 | container.first();
  }
168198
def paintEvent(self, event):
        """"""
        painter = QPainter(self)
        size = self.size()

        color = QColor(self.color)
        color.setAlphaF(.5)
        painter.setPen(color)

        for column in self.columns:
            x = self.editor.fontMetrics().width(column * '9')
            painter.drawLine(x, 0, x, size.height())
988782
def paint( self, painter, option, index ):
        
        # draw the background
        edit = self.parent()
        item = edit.item(index.row())
        if ( not isinstance(item, XMultiTagCreateItem) ):
            if ( item.isSelected() ):
                painter.setBrush(edit.highlightColor())
            else:
                painter.setBrush(edit.tagColor())
            
            painter.drawRect(option.rect)
        
        painter.setBrush(Qt.NoBrush)
        painter.setPen(item.foreground().color())
        
        super(XMultiTagDelegate, self).paint(painter, option, index)
        
        # draw the border
        item = self.parent().item(index.row())
        if ( not isinstance(item, XMultiTagCreateItem) ):
            painter.setPen(edit.borderColor())
            painter.setBrush(Qt.NoBrush)
            painter.drawRect(option.rect)
            painter.drawText(option.rect.right() - 14,
                             option.rect.top() + 1,
                             16,
                             16,
                             Qt.AlignCenter,
                             'x')
1281558
@Override protected void initGraphics() {
        // Set initial size
        if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 ||
            Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) {
            if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) {
                clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight());
            } else {
                clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        ZonedDateTime time = clock.getTime();

        secondBackgroundCircle = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48);
        secondBackgroundCircle.setStrokeWidth(PREFERRED_WIDTH * 0.008);
        secondBackgroundCircle.setStrokeType(StrokeType.CENTERED);
        secondBackgroundCircle.setStrokeLineCap(StrokeLineCap.ROUND);
        secondBackgroundCircle.setFill(null);
        secondBackgroundCircle.setStroke(Helper.getTranslucentColorFrom(clock.getSecondColor(), 0.2));
        secondBackgroundCircle.setVisible(clock.isSecondsVisible());
        secondBackgroundCircle.setManaged(clock.isSecondsVisible());

        dateText = new Text(dateTextFormatter.format(time));
        dateText.setVisible(clock.isDayVisible());
        dateText.setManaged(clock.isDayVisible());

        dateNumbers = new Text(dateNumberFormatter.format(time));
        dateNumbers.setVisible(clock.isDateVisible());
        dateNumbers.setManaged(clock.isDateVisible());

        hour = new Text(HOUR_FORMATTER.format(time));
        hour.setFill(clock.getHourColor());

        minute = new Text(MINUTE_FORMATTER.format(time));
        minute.setFill(clock.getMinuteColor());

        secondArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.96, PREFERRED_WIDTH * 0.48, 90, (-6 * clock.getTime().getSecond()));
        secondArc.setStrokeWidth(PREFERRED_WIDTH * 0.008);
        secondArc.setStrokeType(StrokeType.CENTERED);
        secondArc.setStrokeLineCap(StrokeLineCap.ROUND);
        secondArc.setFill(null);
        secondArc.setStroke(clock.getSecondColor());
        secondArc.setVisible(clock.isSecondsVisible());
        secondArc.setManaged(clock.isSecondsVisible());

        pane = new Pane(secondBackgroundCircle, dateText, dateNumbers, hour, minute, secondArc);
        pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth()))));
        pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY)));

        getChildren().setAll(pane);
    }
1334173
function(){
		var cell = this.getcell();
		if(cell.isnull || cell===this.mouseCell){ return;}
		if(this.inputData===null){ this.decIC(cell);}

		this.mouseCell = cell;

		if(cell.numberRemainsUnshaded && cell.qnums.length!==0 && (this.inputData===1||(this.inputData===2 && !this.puzzle.painter.enablebcolor))){ return;}
		if(this.RBShadeCell && this.inputData===1){
			if(this.firstCell.isnull){ this.firstCell = cell;}
			var cell0 = this.firstCell;
			if(((cell0.bx&2)^(cell0.by&2))!==((cell.bx&2)^(cell.by&2))){ return;}
		}

		(this.inputData===1?cell.setShade:cell.clrShade).call(cell);
		cell.setQsub(this.inputData===2?1:0);

		cell.draw();
	}
1047727
def on_draw(self):
        """"""
        # Skip the drawing if the program hasn't been built yet.
        # The program is built by the interact.
        if self.program:
            # Draw the program.
            self.program.draw(self.gl_primitive_type)
        else:  # pragma: no cover
            logger.debug("Skipping drawing visual `%s` because the program "
                         "has not been built yet.", self)
232053
def colorstart(fgcolor, bgcolor, weight):
    '''  '''
    if weight:
        weight = bold
    else:
        weight = norm
    if bgcolor:
        out('\x1b[%s;%s;%sm' % (weight, fgcolor, bgcolor))
    else:
        out('\x1b[%s;%sm' % (weight, fgcolor))
484886
private void refresh() {
        if (!refreshCheckStart()) {
            return;
        }
        final TileStates tileStates = mTilesOverlay.getTileStates();
        do {
            mTilesOverlay.drawTiles(null, mProjection, mProjection.getZoomLevel(), mViewPort);
            boolean ready = true;
            if (mIncludeFlags != 0 && mIncludeFlags != INCLUDE_FLAGS_ALL) {
                if (ready && (mIncludeFlags & INCLUDE_FLAG_UPTODATE) == 0 && tileStates.getUpToDate() != 0) {
                    ready = false;
                }
                if (ready && (mIncludeFlags & INCLUDE_FLAG_EXPIRED) == 0 && tileStates.getExpired() != 0) {
                    ready = false;
                }
                if (ready && (mIncludeFlags & INCLUDE_FLAG_SCALED) == 0 && tileStates.getScaled() != 0) {
                    ready = false;
                }
                if (ready && (mIncludeFlags & INCLUDE_FLAG_NOTFOUND) == 0 && tileStates.getNotFound() != 0) {
                    ready = false;
                }
            }
            if (ready) {
                if (mStatus == Status.CANVAS_OK || mStatus == Status.PAINTING) {
                    return;
                }
                if (!refreshCheckFinish()) {
                    return;
                }
                mStatus = Status.PAINTING;
                if (mIsDetached) {
                    return;
                }
                draw();
                mStatus = Status.CANVAS_OK;
                final MapSnapshotable mapSnapshotable = mMapSnapshotable;
                if (mapSnapshotable != null) {
                    mapSnapshotable.callback(MapSnapshot.this);
                }
            }
        } while(refreshCheckEnd());
    }
1217802
public boolean isLegalStartColor (int classId, int colorId)
    {
        ColorRecord color = getColorRecord(classId, colorId);
        return (color == null) ? false : color.starter;
    }
871037
protected void init (ManagedRoot root, MediaTimer timer)
    {
        _window = root.getWindow();
        _root = root;
        _root.init(this);
        _timer = timer;

        // set up our custom repaint manager
        _repainter = new ActiveRepaintManager(
            (_root instanceof Component) ? (Component)_root : _window);
        RepaintManager.setCurrentManager(_repainter);

        // turn off double buffering for the whole business because we handle repaints
        _repainter.setDoubleBufferingEnabled(false);
    }
179208
def paintEvent(self, event):
        
        pen = QPen(Qt.DashLine)
        pen.setColor(QColor('red'))
        with XPainter(self) as painter:
            painter.setPen(pen)
            clr = QColor('black')
            clr.setAlpha(100)
            painter.setBrush(clr)
            
            painter.drawRect(self._region)
803391
def repaint
      my_win = @form ? @form.window : @target_window
      @graphic = my_win unless @graphic
      raise " #{@name} NO GRAPHIC set as yet                 CONTAINER paint " unless @graphic
      @components.each { |e| correct_component e } if @first_time
      #@components.each { |e| check_component e } # seeme one if printing out

      #return unless @repaint_required

      # if some major change has happened then repaint everything
      if @repaint_required
        $log.debug " VIM repaint graphic #{@graphic} "
        print_borders unless @suppress_borders # do this once only, unless everything changes
        @components.each { |e| e.repaint_all(true); e.repaint }
      else
        @components.each { |e| e.repaint }
      end # if repaint_required

      @repaint_required = false
    end
964285
def first(self):
        """"""
        self.open()
        seq = SeqIO.parse(self.handle, self.format).next()
        self.close()
        return seq
941943
def paintEvent( self, event ):
        
        super(XRolloutItem, self).paintEvent(event)
        
        with XPainter(self) as painter:
            w = self.width() - 3
            h = self.height() - 3
            
            color = self.palette().color(QPalette.Midlight)
            color = color.darker(180)
            pen = QPen(color)
            pen.setWidthF(0.5)
            
            painter.setPen(pen)
            painter.setBrush(self.palette().color(QPalette.Midlight))
            painter.setRenderHint(XPainter.Antialiasing)
            painter.drawRoundedRect(1, 1, w, h, 10, 10)
714105
public void run()
    {
        // Note: To make sure the user gets a chance to see the
        // html text, we wait for a paint before returing.
        // Since these threads are stacked in a private thread queue, the next
        // thread is not executed until this one is finished.
            if (! EventQueue.isDispatchThread() 
)//            && Runtime.getRuntime().availableProcessors() == 1)
        {
            if (!m_syncPage.isPaintCalled())
            {   // Wait for the previous call to finish
                synchronized (m_syncPage) {
                    while (!m_syncPage.isPaintCalled()) {
                        try { m_syncPage.wait(); } catch (InterruptedException e) {}
                    }
                }
            }
            synchronized (m_syncPage) {
                m_syncPage.setPaintCalled(false);

                this.runPageLoader();

                while (!m_syncPage.isPaintCalled()) {
                    try { m_syncPage.wait(); } catch (InterruptedException e) {}
                }
                
                this.afterPageDisplay();
            }
        }
    }
1356052
def paint( self, painter, option, widget ):
        
        if ( self._rebuildRequired ):
            self.rebuild()
        
        # set the coloring options
        painter.setPen(self.borderColor())
        
        if ( self.isSelected() ):
            painter.setBrush(self.highlightColor())
        else:
            painter.setBrush(self.fillColor())
        
        hints = painter.renderHints()
        if ( not self.isAllDay() ):
            painter.setRenderHint(painter.Antialiasing)
            pen = painter.pen()
            pen.setWidthF(0.25)
            painter.setPen(pen)
        
        painter.drawPath(self.path())
        
        # draw the text in the different rect locations
        title = self.title()
        painter.setPen(self.textColor())
        for data in self._textData:
            painter.drawText(*data)
        
        painter.setRenderHints(hints)