gfx/skia/trunk/src/gpu/GrRectanizer.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2  * Copyright 2010 Google Inc.
     3  *
     4  * Use of this source code is governed by a BSD-style license that can be
     5  * found in the LICENSE file.
     6  */
     8 #ifndef GrRectanizer_DEFINED
     9 #define GrRectanizer_DEFINED
    11 #include "GrPoint.h"
    13 class GrRectanizerPurgeListener {
    14 public:
    15     virtual ~GrRectanizerPurgeListener() {}
    17     virtual void notifyPurgeStrip(void*, int yCoord) = 0;
    18 };
    20 class GrRectanizer {
    21 public:
    22     GrRectanizer(int width, int height) : fWidth(width), fHeight(height) {
    23         SkASSERT(width >= 0);
    24         SkASSERT(height >= 0);
    25     }
    27     virtual ~GrRectanizer() {}
    29     virtual void reset() = 0;
    31     int width() const { return fWidth; }
    32     int height() const { return fHeight; }
    34     virtual bool addRect(int width, int height, GrIPoint16* loc) = 0;
    35     virtual float percentFull() const = 0;
    37     // return the Y-coordinate of a strip that should be purged, given height
    38     // i.e. return the oldest such strip, or some other criteria. Return -1
    39     // if there is no candidate
    40     virtual int stripToPurge(int height) const = 0;
    41     virtual void purgeStripAtY(int yCoord) = 0;
    43     /**
    44      *  Our factory, which returns the subclass du jour
    45      */
    46     static GrRectanizer* Factory(int width, int height);
    48 private:
    49     int fWidth;
    50     int fHeight;
    51 };
    53 #endif

mercurial