/* Generated by Cython 0.21.1 */

#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_21_1"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ? \
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
  #define __Pyx_PyFrozenSet_Size(s)         PyObject_Size(s)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  #define __Pyx_PyFrozenSet_Size(s)         PySet_Size(s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet NaN. */
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#ifdef __cplusplus
template<typename T>
void __Pyx_call_destructor(T* x) {
    x->~T();
}
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__renpy__display__render
#define __PYX_HAVE_API__renpy__display__render
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (    \
    (sizeof(type) < sizeof(Py_ssize_t))  ||             \
    (sizeof(type) > sizeof(Py_ssize_t) &&               \
          likely(v < (type)PY_SSIZE_T_MAX ||            \
                 v == (type)PY_SSIZE_T_MAX)  &&         \
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||       \
                                v == (type)PY_SSIZE_T_MIN)))  ||  \
    (sizeof(type) == sizeof(Py_ssize_t) &&              \
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||        \
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromUString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "renpy/display/render.pyx",
  "renpy/display/render.pxd",
  "renpy/display/matrix.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_5renpy_7display_6matrix_Matrix;
struct __pyx_obj_5renpy_7display_6matrix_Matrix2D;
struct __pyx_obj_5renpy_7display_6render_Render;
struct __pyx_opt_args_5renpy_7display_6render_6Render_blit;
struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit;
struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit;

/* "renpy/display/render.pxd":107
 *     # operations ###############################################################
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/render.pxd":108
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 * 
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/render.pxd":109
 *     cpdef int blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=*, object main=*, object index=*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit {
  int __pyx_n;
  PyObject *focus;
  PyObject *main;
  PyObject *index;
};

/* "renpy/display/matrix.pxd":1
 * cdef class Matrix:             # <<<<<<<<<<<<<<
 * 
 *     cdef float m[0]
 */
struct __pyx_obj_5renpy_7display_6matrix_Matrix {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix *__pyx_vtab;
  float m[0];
  float xdx;
  float xdy;
  float xdz;
  float xdw;
  float ydx;
  float ydy;
  float ydz;
  float ydw;
  float zdx;
  float zdy;
  float zdz;
  float zdw;
  float wdx;
  float wdy;
  float wdz;
  float wdw;
};


/* "renpy/display/matrix.pxd":43
 *     cpdef bint is_unit_aligned(Matrix self)
 * 
 * cdef class Matrix2D(Matrix):             # <<<<<<<<<<<<<<
 *     pass
 */
struct __pyx_obj_5renpy_7display_6matrix_Matrix2D {
  struct __pyx_obj_5renpy_7display_6matrix_Matrix __pyx_base;
};


/* "renpy/display/render.pxd":25
 * from renpy.display.matrix cimport Matrix, Matrix2D
 * 
 * cdef class Render:             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint mark, cache_killed
 */
struct __pyx_obj_5renpy_7display_6render_Render {
  PyObject_HEAD
  struct __pyx_vtabstruct_5renpy_7display_6render_Render *__pyx_vtab;
  int mark;
  int cache_killed;
  float width;
  float height;
  PyObject *layer_name;
  PyObject *children;
  PyObject *parents;
  PyObject *depends_on_list;
  int operation;
  double operation_complete;
  int operation_alpha;
  PyObject *operation_parameter;
  struct __pyx_obj_5renpy_7display_6matrix_Matrix *forward;
  struct __pyx_obj_5renpy_7display_6matrix_Matrix *reverse;
  double alpha;
  double over;
  PyObject *nearest;
  PyObject *focuses;
  PyObject *pass_focuses;
  PyObject *focus_screen;
  PyObject *draw_func;
  PyObject *render_of;
  int opaque;
  PyObject *visible_children;
  int xclipping;
  int yclipping;
  PyObject *surface;
  PyObject *alpha_surface;
  PyObject *half_cache;
  int modal;
  int text_input;
  PyObject *mesh;
  PyObject *shaders;
  PyObject *uniforms;
  PyObject *properties;
  PyObject *cached_texture;
  PyObject *cached_model;
  int loaded;
};



/* "renpy/display/matrix.pxd":1
 * cdef class Matrix:             # <<<<<<<<<<<<<<
 * 
 *     cdef float m[0]
 */

struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix {
  void (*transform4)(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float *, float *, float, float, float, float);
  void (*transform3)(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float *, float, float, float, float);
  void (*transform2)(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float, float, float, float);
  int (*is_unit_aligned)(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix *__pyx_vtabptr_5renpy_7display_6matrix_Matrix;
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform4(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float *, float *, float, float, float, float);
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform3(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float *, float, float, float, float);
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform2(struct __pyx_obj_5renpy_7display_6matrix_Matrix *, float *, float *, float, float, float, float);


/* "renpy/display/matrix.pxd":43
 *     cpdef bint is_unit_aligned(Matrix self)
 * 
 * cdef class Matrix2D(Matrix):             # <<<<<<<<<<<<<<
 *     pass
 */

struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix2D {
  struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix __pyx_base;
};
static struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix2D *__pyx_vtabptr_5renpy_7display_6matrix_Matrix2D;


/* "renpy/display/render.pyx":579
 * FLATTEN = 4
 * 
 * cdef class Render:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(Render self, float width, float height, draw_func=None, layer_name=None, bint opaque=False): #@DuplicatedSignature
 */

struct __pyx_vtabstruct_5renpy_7display_6render_Render {
  int (*blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_blit *__pyx_optional_args);
  int (*subpixel_blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit *__pyx_optional_args);
  int (*absolute_blit)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5renpy_7display_6render_Render *__pyx_vtabptr_5renpy_7display_6render_Render;
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          if (acquire_gil) { \
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
              PyGILState_Release(__pyx_gilstate_save); \
          } else { \
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil) \
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext() \
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {                            \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_XDECREF(tmp);                              \
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {                             \
        PyObject *tmp = (PyObject *) r;                         \
        r = v; __Pyx_DECREF(tmp);                               \
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
    const char* function_name);

static CYTHON_INLINE int __Pyx_IterFinish(void);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
                                             int is_tuple, int has_known_size, int decref_tuple);

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
    int result = PySequence_Contains(seq, item);
    return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback);

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj) \
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) : \
 likely(PyInt_CheckExact(obj)) ? \
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj) \
((likely(PyFloat_CheckExact(obj))) ? \
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
    __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject* none = _PyList_Extend((PyListObject*)L, v);
    if (unlikely(!none))
        return -1;
    Py_DECREF(none);
    return 0;
#else
    return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
#endif
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

static void* __Pyx_GetVtable(PyObject *dict);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static PyObject* __Pyx_Globals(void);

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f) \
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f) \
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f) \
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __Pyx_CyFunction_init(void);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);

#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

static PyObject *__Pyx_ImportModule(const char *name);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static int __pyx_f_5renpy_7display_6render_6Render_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_blit *__pyx_optional_args); /* proto*/
static int __pyx_f_5renpy_7display_6render_6Render_subpixel_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit *__pyx_optional_args); /* proto*/
static int __pyx_f_5renpy_7display_6render_6Render_absolute_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit *__pyx_optional_args); /* proto*/
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform4(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float *__pyx_v_oz, float *__pyx_v_ow, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w); /* proto*/
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform3(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float *__pyx_v_oz, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w); /* proto*/
static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform2(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w); /* proto*/

/* Module declarations from 'renpy.display.matrix' */
static PyTypeObject *__pyx_ptype_5renpy_7display_6matrix_Matrix = 0;
static PyTypeObject *__pyx_ptype_5renpy_7display_6matrix_Matrix2D = 0;

/* Module declarations from 'renpy.display.render' */
static PyTypeObject *__pyx_ptype_5renpy_7display_6render_Render = 0;
static PyObject *__pyx_v_5renpy_7display_6render_live_renders = 0;
static double __pyx_v_5renpy_7display_6render_frame_time;
static int __pyx_v_5renpy_7display_6render_rendering;
static int __pyx_v_5renpy_7display_6render_render_is_ready;
static PyObject *__pyx_f_5renpy_7display_6render_render(PyObject *, PyObject *, PyObject *, double, double, int __pyx_skip_dispatch); /*proto*/
#define __Pyx_MODULE_NAME "renpy.display.render"
int __pyx_module_is_main_renpy__display__render = 0;

/* Implementation of 'renpy.display.render' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_pf_5renpy_7display_6render_adjust_render_cache_times(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_old_time, PyObject *__pyx_v_new_time); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_2free_memory(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_4check_at_shutdown(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6render_ready(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_8render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_widtho, PyObject *__pyx_v_heighto, double __pyx_v_st, double __pyx_v_at); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_10render_for_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_st, PyObject *__pyx_v_at); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_12invalidate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_14check_redraws(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_16process_redraws(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_18redraw_time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_20redraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_when); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_22take_focuses(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_focuses); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_24focus_at_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_26mutated_surface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surf); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_28render_screen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_root, PyObject *__pyx_v_width, PyObject *__pyx_v_height); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_30mark_sweep(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_32compute_subline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sx0, PyObject *__pyx_v_sw, PyObject *__pyx_v_cx0, PyObject *__pyx_v_cw); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render___init__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, float __pyx_v_width, float __pyx_v_height, PyObject *__pyx_v_draw_func, PyObject *__pyx_v_layer_name, int __pyx_v_opaque); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_2__repr__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4__getstate__(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6__setstate__(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10subpixel_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12absolute_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_14get_size(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_16render_to_texture(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_18subsurface(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_rect, PyObject *__pyx_v_focus); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_20depends_on(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_focus); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_22kill_cache(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_24kill(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_26add_focus(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_d, PyObject *__pyx_v_arg, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_mx, PyObject *__pyx_v_my, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_28take_focuses(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_cminx, PyObject *__pyx_v_cminy, PyObject *__pyx_v_cmaxx, PyObject *__pyx_v_cmaxy, PyObject *__pyx_v_reverse, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_screen, PyObject *__pyx_v_focuses); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_30focus_at_point(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_screen); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_32main_displayables_at_point(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_layers, PyObject *__pyx_v_depth); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_34is_opaque(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_36is_pixel_opaque(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_38fill(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_color); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_40canvas(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_42screen_rect(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, double __pyx_v_sx, double __pyx_v_sy, struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_transform); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_44place(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_d, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_st, PyObject *__pyx_v_at, PyObject *__pyx_v_render, PyObject *__pyx_v_main); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_46zoom(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_xzoom, PyObject *__pyx_v_yzoom); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4mark___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_4mark_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12cache_killed___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12cache_killed_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5width___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_5width_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6height___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_6height_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10layer_name___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10layer_name_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10layer_name_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8children___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_8children_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_8children_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7parents___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7parents_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7parents_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_15depends_on_list___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9operation___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9operation_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_18operation_complete___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_18operation_complete_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_15operation_alpha___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_15operation_alpha_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_19operation_parameter___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7forward___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7forward_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7forward_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7reverse___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7reverse_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7reverse_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5alpha___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_5alpha_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4over___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_4over_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7nearest___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7nearest_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7nearest_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7focuses___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7focuses_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7focuses_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12pass_focuses___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12focus_screen___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9draw_func___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9draw_func_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9draw_func_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9render_of___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9render_of_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9render_of_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6opaque___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_6opaque_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_16visible_children___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_16visible_children_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_16visible_children_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9xclipping___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9xclipping_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9yclipping___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_9yclipping_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7surface___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7surface_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7surface_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_13alpha_surface___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10half_cache___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10half_cache_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10half_cache_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5modal___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_5modal_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10text_input___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10text_input_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4mesh___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_4mesh_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_4mesh_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7shaders___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7shaders_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_7shaders_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8uniforms___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_8uniforms_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_8uniforms_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10properties___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10properties_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_10properties_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_14cached_texture___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12cached_model___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12cached_model_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_12cached_model_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6loaded___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self); /* proto */
static int __pyx_pf_5renpy_7display_6render_6Render_6loaded_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_surf); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_4polygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_6circle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_8ellipse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_10arc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_start_angle, PyObject *__pyx_v_stop_angle, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_12line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_14lines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_16aaline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, PyObject *__pyx_v_blend); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_18aalines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_blend); /* proto */
static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_20get_surface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_5renpy_7display_6render_Render(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_d[] = "d";
static char __pyx_k_h[] = "h";
static char __pyx_k_i[] = "i";
static char __pyx_k_j[] = "j";
static char __pyx_k_k[] = "k";
static char __pyx_k_l[] = "l";
static char __pyx_k_r[] = "r";
static char __pyx_k_t[] = "t";
static char __pyx_k_v[] = "v";
static char __pyx_k_w[] = "w";
static char __pyx_k_x[] = "x";
static char __pyx_k_y[] = "y";
static char __pyx_k__4[] = "";
static char __pyx_k_at[] = "at";
static char __pyx_k_cf[] = "cf";
static char __pyx_k_cw[] = "cw";
static char __pyx_k_gc[] = "gc";
static char __pyx_k_id[] = "id";
static char __pyx_k_mx[] = "mx";
static char __pyx_k_my[] = "my";
static char __pyx_k_rv[] = "rv";
static char __pyx_k_st[] = "st";
static char __pyx_k_sw[] = "sw";
static char __pyx_k_sx[] = "sx";
static char __pyx_k_sy[] = "sy";
static char __pyx_k_add[] = "add";
static char __pyx_k_arc[] = "arc";
static char __pyx_k_arg[] = "arg";
static char __pyx_k_cx0[] = "cx0";
static char __pyx_k_cx1[] = "cx1";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_get[] = "get";
static char __pyx_k_now[] = "now";
static char __pyx_k_pos[] = "pos";
static char __pyx_k_sx0[] = "sx0";
static char __pyx_k_sx1[] = "sx1";
static char __pyx_k_BLIT[] = "BLIT";
static char __pyx_k_blit[] = "blit";
static char __pyx_k_ceil[] = "ceil";
static char __pyx_k_core[] = "core";
static char __pyx_k_crop[] = "crop";
static char __pyx_k_dead[] = "dead ";
static char __pyx_k_draw[] = "draw";
static char __pyx_k_easy[] = "easy";
static char __pyx_k_game[] = "game";
static char __pyx_k_id_d[] = "id_d";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_line[] = "line";
static char __pyx_k_main[] = "main";
static char __pyx_k_mark[] = "mark";
static char __pyx_k_mask[] = "mask";
static char __pyx_k_math[] = "math";
static char __pyx_k_plog[] = "plog";
static char __pyx_k_rect[] = "rect";
static char __pyx_k_root[] = "root";
static char __pyx_k_seen[] = "seen";
static char __pyx_k_self[] = "self";
static char __pyx_k_sort[] = "sort";
static char __pyx_k_surf[] = "surf";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_when[] = "when";
static char __pyx_k_Focus[] = "Focus";
static char __pyx_k_Modal[] = "Modal";
static char __pyx_k_Solid[] = "Solid";
static char __pyx_k_alpha[] = "alpha";
static char __pyx_k_blend[] = "blend";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_clear[] = "clear";
static char __pyx_k_cmaxx[] = "cmaxx";
static char __pyx_k_cmaxy[] = "cmaxy";
static char __pyx_k_cminx[] = "cminx";
static char __pyx_k_cminy[] = "cminy";
static char __pyx_k_color[] = "color";
static char __pyx_k_count[] = "count";
static char __pyx_k_depth[] = "depth";
static char __pyx_k_focus[] = "focus";
static char __pyx_k_index[] = "index";
static char __pyx_k_items[] = "items";
static char __pyx_k_lines[] = "lines";
static char __pyx_k_place[] = "place";
static char __pyx_k_renpy[] = "renpy";
static char __pyx_k_start[] = "start";
static char __pyx_k_style[] = "style";
static char __pyx_k_width[] = "width";
static char __pyx_k_xzoom[] = "xzoom";
static char __pyx_k_yzoom[] = "yzoom";
static char __pyx_k_Canvas[] = "Canvas";
static char __pyx_k_Matrix[] = "Matrix";
static char __pyx_k_aaline[] = "aaline";
static char __pyx_k_append[] = "append";
static char __pyx_k_circle[] = "circle";
static char __pyx_k_closed[] = "closed";
static char __pyx_k_config[] = "config";
static char __pyx_k_endpos[] = "endpos";
static char __pyx_k_format[] = "format";
static char __pyx_k_height[] = "height";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_layers[] = "layers";
static char __pyx_k_main_2[] = "__main__";
static char __pyx_k_models[] = "models";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_object[] = "object";
static char __pyx_k_offset[] = "offset";
static char __pyx_k_opaque[] = "opaque";
static char __pyx_k_pygame[] = "pygame";
static char __pyx_k_radius[] = "radius";
static char __pyx_k_redraw[] = "redraw";
static char __pyx_k_render[] = "render";
static char __pyx_k_screen[] = "screen";
static char __pyx_k_sizing[] = "sizing";
static char __pyx_k_source[] = "source";
static char __pyx_k_values[] = "values";
static char __pyx_k_widtho[] = "widtho";
static char __pyx_k_FLATTEN[] = "FLATTEN";
static char __pyx_k_aalines[] = "aalines";
static char __pyx_k_acquire[] = "acquire";
static char __pyx_k_at_base[] = "at_base";
static char __pyx_k_collect[] = "collect";
static char __pyx_k_discard[] = "discard";
static char __pyx_k_display[] = "display";
static char __pyx_k_ellipse[] = "ellipse";
static char __pyx_k_end_pos[] = "end_pos";
static char __pyx_k_focuses[] = "focuses";
static char __pyx_k_heighto[] = "heighto";
static char __pyx_k_objects[] = "objects";
static char __pyx_k_orig_wh[] = "orig_wh";
static char __pyx_k_parents[] = "parents";
static char __pyx_k_polygon[] = "polygon";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_release[] = "release";
static char __pyx_k_renders[] = "renders";
static char __pyx_k_reverse[] = "reverse";
static char __pyx_k_st_base[] = "st_base";
static char __pyx_k_surface[] = "surface";
static char __pyx_k_DISSOLVE[] = "DISSOLVE";
static char __pyx_k_IDENTITY[] = "IDENTITY";
static char __pyx_k_Matrix2D[] = "Matrix2D";
static char __pyx_k_Sentinel[] = "Sentinel";
static char __pyx_k_absolute[] = "absolute";
static char __pyx_k_clipping[] = "_clipping";
static char __pyx_k_get_size[] = "get_size";
static char __pyx_k_get_time[] = "get_time";
static char __pyx_k_new_time[] = "new_time";
static char __pyx_k_old_time[] = "old_time";
static char __pyx_k_pgrender[] = "pgrender";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_startpos[] = "startpos";
static char __pyx_k_surftree[] = "surftree";
static char __pyx_k_worklist[] = "worklist";
static char __pyx_k_xmaximum[] = "xmaximum";
static char __pyx_k_ymaximum[] = "ymaximum";
static char __pyx_k_Condition[] = "Condition";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_PIXELLATE[] = "PIXELLATE";
static char __pyx_k_add_focus[] = "add_focus";
static char __pyx_k_blit_lock[] = "blit_lock";
static char __pyx_k_developer[] = "developer";
static char __pyx_k_draw_func[] = "draw_func";
static char __pyx_k_imagelike[] = "imagelike";
static char __pyx_k_interface[] = "interface";
static char __pyx_k_is_opaque[] = "is_opaque";
static char __pyx_k_iteritems[] = "iteritems";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_per_frame[] = "per_frame";
static char __pyx_k_pointlist[] = "pointlist";
static char __pyx_k_render_at[] = "render_at";
static char __pyx_k_render_of[] = "render_of";
static char __pyx_k_render_st[] = "render_st";
static char __pyx_k_start_pos[] = "start_pos";
static char __pyx_k_threading[] = "threading";
static char __pyx_k_transform[] = "transform";
static char __pyx_k_xclipping[] = "xclipping";
static char __pyx_k_yclipping[] = "yclipping";
static char __pyx_k_Canvas_arc[] = "Canvas.arc";
static char __pyx_k_depends_on[] = "depends_on";
static char __pyx_k_frame_time[] = "frame_time";
static char __pyx_k_invalidate[] = "invalidate";
static char __pyx_k_kill_cache[] = "kill_cache";
static char __pyx_k_layer_name[] = "layer_name";
static char __pyx_k_mark_sweep[] = "mark_sweep";
static char __pyx_k_old_sizing[] = "old_sizing";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_stop_angle[] = "stop_angle";
static char __pyx_k_subsurface[] = "subsurface";
static char __pyx_k_Canvas_line[] = "Canvas.line";
static char __pyx_k_Canvas_rect[] = "Canvas.rect";
static char __pyx_k_collections[] = "collections";
static char __pyx_k_defaultdict[] = "defaultdict";
static char __pyx_k_free_memory[] = "free_memory";
static char __pyx_k_get_objects[] = "get_objects";
static char __pyx_k_get_surface[] = "get_surface";
static char __pyx_k_invalidated[] = "invalidated";
static char __pyx_k_new_renders[] = "new_renders";
static char __pyx_k_pygame_sdl2[] = "pygame_sdl2";
static char __pyx_k_redraw_time[] = "redraw_time";
static char __pyx_k_start_angle[] = "start_angle";
static char __pyx_k_Canvas_lines[] = "Canvas.lines";
static char __pyx_k_cache_killed[] = "cache_killed";
static char __pyx_k_end_render_r[] = "end render {!r}";
static char __pyx_k_redraw_queue[] = "redraw_queue";
static char __pyx_k_render_cache[] = "render_cache";
static char __pyx_k_render_ready[] = "render_ready";
static char __pyx_k_render_width[] = "render_width";
static char __pyx_k_take_focuses[] = "take_focuses";
static char __pyx_k_Canvas___init[] = "Canvas.__init__";
static char __pyx_k_Canvas_aaline[] = "Canvas.aaline";
static char __pyx_k_Canvas_circle[] = "Canvas.circle";
static char __pyx_k_IMAGEDISSOLVE[] = "IMAGEDISSOLVE";
static char __pyx_k_Render_x_of_r[] = "<{}Render {:x} of {!r}>";
static char __pyx_k_absolute_blit[] = "absolute_blit";
static char __pyx_k_check_redraws[] = "check_redraws";
static char __pyx_k_interact_time[] = "interact_time";
static char __pyx_k_render_height[] = "render_height";
static char __pyx_k_render_screen[] = "render_screen";
static char __pyx_k_screen_render[] = "screen_render";
static char __pyx_k_subpixel_blit[] = "subpixel_blit";
static char __pyx_k_Canvas_aalines[] = "Canvas.aalines";
static char __pyx_k_Canvas_ellipse[] = "Canvas.ellipse";
static char __pyx_k_Canvas_polygon[] = "Canvas.polygon";
static char __pyx_k_after_clipping[] = "after clipping";
static char __pyx_k_focus_at_point[] = "focus_at_point";
static char __pyx_k_pygame_surface[] = "pygame_surface";
static char __pyx_k_render_cache_d[] = "render_cache_d";
static char __pyx_k_start_render_r[] = "start render {!r}";
static char __pyx_k_before_clipping[] = "before clipping";
static char __pyx_k_compute_subline[] = "compute_subline";
static char __pyx_k_is_pixel_opaque[] = "is_pixel_opaque";
static char __pyx_k_mutated_surface[] = "mutated_surface";
static char __pyx_k_process_redraws[] = "process_redraws";
static char __pyx_k_render_for_size[] = "render_for_size";
static char __pyx_k_Blitting_to_self[] = "Blitting to self.";
static char __pyx_k_new_redraw_queue[] = "new_redraw_queue";
static char __pyx_k_ScreenDisplayable[] = "ScreenDisplayable";
static char __pyx_k_check_at_shutdown[] = "check_at_shutdown";
static char __pyx_k_render_to_texture[] = "render_to_texture";
static char __pyx_k_Canvas_get_surface[] = "Canvas.get_surface";
static char __pyx_k_renpy_display_matrix[] = "renpy.display.matrix";
static char __pyx_k_renpy_display_render[] = "renpy.display.render";
static char __pyx_k_Can_t_pickle_a_Render[] = "Can't pickle a Render.";
static char __pyx_k_Render_depends_on_itself[] = "Render depends on itself.";
static char __pyx_k_adjust_render_cache_times[] = "adjust_render_cache_times";
static char __pyx_k_main_displayables_at_point[] = "main_displayables_at_point";
static char __pyx_k_r_render_must_return_a_Render[] = "{!r}.render() must return a Render.";
static char __pyx_k_Users_tom_ab_renpy_renpy_displa[] = "/Users/tom/ab/renpy/renpy/display/render.pyx";
static char __pyx_k_d_Renders_are_alive_at_shutdown[] = "%d Renders are alive at shutdown. This is probably a memory leak bug in Ren'Py.";
static char __pyx_k_Creating_subsurface_failed_child[] = "Creating subsurface failed. child size = ({}, {}), crop = {!r}";
static char __pyx_k_Displayables_may_not_be_rendered[] = "Displayables may not be rendered during the init phase.";
static PyObject *__pyx_n_s_BLIT;
static PyObject *__pyx_kp_s_Blitting_to_self;
static PyObject *__pyx_kp_s_Can_t_pickle_a_Render;
static PyObject *__pyx_n_s_Canvas;
static PyObject *__pyx_n_s_Canvas___init;
static PyObject *__pyx_n_s_Canvas_aaline;
static PyObject *__pyx_n_s_Canvas_aalines;
static PyObject *__pyx_n_s_Canvas_arc;
static PyObject *__pyx_n_s_Canvas_circle;
static PyObject *__pyx_n_s_Canvas_ellipse;
static PyObject *__pyx_n_s_Canvas_get_surface;
static PyObject *__pyx_n_s_Canvas_line;
static PyObject *__pyx_n_s_Canvas_lines;
static PyObject *__pyx_n_s_Canvas_polygon;
static PyObject *__pyx_n_s_Canvas_rect;
static PyObject *__pyx_n_s_Condition;
static PyObject *__pyx_kp_s_Creating_subsurface_failed_child;
static PyObject *__pyx_n_s_DISSOLVE;
static PyObject *__pyx_kp_s_Displayables_may_not_be_rendered;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_n_s_FLATTEN;
static PyObject *__pyx_n_s_Focus;
static PyObject *__pyx_n_s_IDENTITY;
static PyObject *__pyx_n_s_IMAGEDISSOLVE;
static PyObject *__pyx_n_s_Matrix;
static PyObject *__pyx_n_s_Matrix2D;
static PyObject *__pyx_n_s_Modal;
static PyObject *__pyx_n_s_PIXELLATE;
static PyObject *__pyx_kp_s_Render_depends_on_itself;
static PyObject *__pyx_kp_s_Render_x_of_r;
static PyObject *__pyx_n_s_ScreenDisplayable;
static PyObject *__pyx_n_s_Sentinel;
static PyObject *__pyx_n_s_Solid;
static PyObject *__pyx_kp_s_Users_tom_ab_renpy_renpy_displa;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_n_s_aaline;
static PyObject *__pyx_n_s_aalines;
static PyObject *__pyx_n_s_absolute;
static PyObject *__pyx_n_s_absolute_blit;
static PyObject *__pyx_n_s_acquire;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_add_focus;
static PyObject *__pyx_n_s_adjust_render_cache_times;
static PyObject *__pyx_kp_s_after_clipping;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arc;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_at;
static PyObject *__pyx_n_s_at_base;
static PyObject *__pyx_kp_s_before_clipping;
static PyObject *__pyx_n_s_blend;
static PyObject *__pyx_n_s_blit;
static PyObject *__pyx_n_s_blit_lock;
static PyObject *__pyx_n_s_cache_killed;
static PyObject *__pyx_n_s_ceil;
static PyObject *__pyx_n_s_cf;
static PyObject *__pyx_n_s_check_at_shutdown;
static PyObject *__pyx_n_s_check_redraws;
static PyObject *__pyx_n_s_circle;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_clipping;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_cmaxx;
static PyObject *__pyx_n_s_cmaxy;
static PyObject *__pyx_n_s_cminx;
static PyObject *__pyx_n_s_cminy;
static PyObject *__pyx_n_s_collect;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_n_s_compute_subline;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_core;
static PyObject *__pyx_n_s_count;
static PyObject *__pyx_n_s_crop;
static PyObject *__pyx_n_s_cw;
static PyObject *__pyx_n_s_cx0;
static PyObject *__pyx_n_s_cx1;
static PyObject *__pyx_n_s_d;
static PyObject *__pyx_kp_s_d_Renders_are_alive_at_shutdown;
static PyObject *__pyx_kp_s_dead;
static PyObject *__pyx_n_s_defaultdict;
static PyObject *__pyx_n_s_depends_on;
static PyObject *__pyx_n_s_depth;
static PyObject *__pyx_n_s_developer;
static PyObject *__pyx_n_s_discard;
static PyObject *__pyx_n_s_display;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_s_draw_func;
static PyObject *__pyx_n_s_easy;
static PyObject *__pyx_n_s_ellipse;
static PyObject *__pyx_n_s_end_pos;
static PyObject *__pyx_kp_s_end_render_r;
static PyObject *__pyx_n_s_endpos;
static PyObject *__pyx_n_s_focus;
static PyObject *__pyx_n_s_focus_at_point;
static PyObject *__pyx_n_s_focuses;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_frame_time;
static PyObject *__pyx_n_s_free_memory;
static PyObject *__pyx_n_s_game;
static PyObject *__pyx_n_s_gc;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_objects;
static PyObject *__pyx_n_s_get_size;
static PyObject *__pyx_n_s_get_surface;
static PyObject *__pyx_n_s_get_time;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_s_heighto;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_id_d;
static PyObject *__pyx_n_s_imagelike;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_interact_time;
static PyObject *__pyx_n_s_interface;
static PyObject *__pyx_n_s_invalidate;
static PyObject *__pyx_n_s_invalidated;
static PyObject *__pyx_n_s_is_opaque;
static PyObject *__pyx_n_s_is_pixel_opaque;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_kill_cache;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_layer_name;
static PyObject *__pyx_n_s_layers;
static PyObject *__pyx_n_s_line;
static PyObject *__pyx_n_s_lines;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_main_2;
static PyObject *__pyx_n_s_main_displayables_at_point;
static PyObject *__pyx_n_s_mark;
static PyObject *__pyx_n_s_mark_sweep;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_models;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mutated_surface;
static PyObject *__pyx_n_s_mx;
static PyObject *__pyx_n_s_my;
static PyObject *__pyx_n_s_new_redraw_queue;
static PyObject *__pyx_n_s_new_renders;
static PyObject *__pyx_n_s_new_time;
static PyObject *__pyx_n_s_now;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_objects;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_old_sizing;
static PyObject *__pyx_n_s_old_time;
static PyObject *__pyx_n_s_opaque;
static PyObject *__pyx_n_s_orig_wh;
static PyObject *__pyx_n_s_parents;
static PyObject *__pyx_n_s_per_frame;
static PyObject *__pyx_n_s_pgrender;
static PyObject *__pyx_n_s_place;
static PyObject *__pyx_n_s_plog;
static PyObject *__pyx_n_s_pointlist;
static PyObject *__pyx_n_s_polygon;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_process_redraws;
static PyObject *__pyx_n_s_pygame;
static PyObject *__pyx_n_s_pygame_sdl2;
static PyObject *__pyx_n_s_pygame_surface;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_kp_s_r_render_must_return_a_Render;
static PyObject *__pyx_n_s_radius;
static PyObject *__pyx_n_s_rect;
static PyObject *__pyx_n_s_redraw;
static PyObject *__pyx_n_s_redraw_queue;
static PyObject *__pyx_n_s_redraw_time;
static PyObject *__pyx_n_s_release;
static PyObject *__pyx_n_s_render;
static PyObject *__pyx_n_s_render_at;
static PyObject *__pyx_n_s_render_cache;
static PyObject *__pyx_n_s_render_cache_d;
static PyObject *__pyx_n_s_render_for_size;
static PyObject *__pyx_n_s_render_height;
static PyObject *__pyx_n_s_render_of;
static PyObject *__pyx_n_s_render_ready;
static PyObject *__pyx_n_s_render_screen;
static PyObject *__pyx_n_s_render_st;
static PyObject *__pyx_n_s_render_to_texture;
static PyObject *__pyx_n_s_render_width;
static PyObject *__pyx_n_s_renders;
static PyObject *__pyx_n_s_renpy;
static PyObject *__pyx_n_s_renpy_display_matrix;
static PyObject *__pyx_n_s_renpy_display_render;
static PyObject *__pyx_n_s_reverse;
static PyObject *__pyx_n_s_root;
static PyObject *__pyx_n_s_rv;
static PyObject *__pyx_n_s_screen;
static PyObject *__pyx_n_s_screen_render;
static PyObject *__pyx_n_s_seen;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_sizing;
static PyObject *__pyx_n_s_sort;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_st;
static PyObject *__pyx_n_s_st_base;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_start_angle;
static PyObject *__pyx_n_s_start_pos;
static PyObject *__pyx_kp_s_start_render_r;
static PyObject *__pyx_n_s_startpos;
static PyObject *__pyx_n_s_stop_angle;
static PyObject *__pyx_n_s_style;
static PyObject *__pyx_n_s_subpixel_blit;
static PyObject *__pyx_n_s_subsurface;
static PyObject *__pyx_n_s_surf;
static PyObject *__pyx_n_s_surface;
static PyObject *__pyx_n_s_surftree;
static PyObject *__pyx_n_s_sw;
static PyObject *__pyx_n_s_sx;
static PyObject *__pyx_n_s_sx0;
static PyObject *__pyx_n_s_sx1;
static PyObject *__pyx_n_s_sy;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_take_focuses;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_transform;
static PyObject *__pyx_n_s_v;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_when;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_widtho;
static PyObject *__pyx_n_s_worklist;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xclipping;
static PyObject *__pyx_n_s_xmaximum;
static PyObject *__pyx_n_s_xzoom;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_yclipping;
static PyObject *__pyx_n_s_ymaximum;
static PyObject *__pyx_n_s_yzoom;
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_slice__7;
static PyObject *__pyx_slice__9;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_slice__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_codeobj__15;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
static PyObject *__pyx_codeobj__23;
static PyObject *__pyx_codeobj__25;
static PyObject *__pyx_codeobj__27;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__42;
static PyObject *__pyx_codeobj__44;
static PyObject *__pyx_codeobj__46;
static PyObject *__pyx_codeobj__48;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__54;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__60;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__72;
static PyObject *__pyx_codeobj__75;

/* "renpy/display/render.pyx":74
 * models = False
 * 
 * def adjust_render_cache_times(old_time, new_time):             # <<<<<<<<<<<<<<
 *     """
 *     This adjusts the render cache such that if a render starts at
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_1adjust_render_cache_times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_adjust_render_cache_times[] = "\n    This adjusts the render cache such that if a render starts at\n    old_time, it really started at new_time.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_1adjust_render_cache_times = {"adjust_render_cache_times", (PyCFunction)__pyx_pw_5renpy_7display_6render_1adjust_render_cache_times, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_adjust_render_cache_times};
static PyObject *__pyx_pw_5renpy_7display_6render_1adjust_render_cache_times(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_old_time = 0;
  PyObject *__pyx_v_new_time = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("adjust_render_cache_times (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_old_time,&__pyx_n_s_new_time,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old_time)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_time)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("adjust_render_cache_times", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "adjust_render_cache_times") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_old_time = values[0];
    __pyx_v_new_time = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("adjust_render_cache_times", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.adjust_render_cache_times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_adjust_render_cache_times(__pyx_self, __pyx_v_old_time, __pyx_v_new_time);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_adjust_render_cache_times(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_old_time, PyObject *__pyx_v_new_time) {
  PyObject *__pyx_v_id_d = NULL;
  PyObject *__pyx_v_renders = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_new_renders = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_st_base = NULL;
  PyObject *__pyx_v_at_base = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  int __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("adjust_render_cache_times", 0);

  /* "renpy/display/render.pyx":80
 *     """
 * 
 *     for id_d, renders in render_cache.iteritems():             # <<<<<<<<<<<<<<
 * 
 *         # Check to see if we have a render with st_base = old_time. If so,
 */
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_6 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_id_d, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_renders, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":84
 *         # Check to see if we have a render with st_base = old_time. If so,
 *         # we need to rebase it.
 *         for k in renders:             # <<<<<<<<<<<<<<
 *             if k[2] == old_time:
 *                 break
 */
    if (likely(PyList_CheckExact(__pyx_v_renders)) || PyTuple_CheckExact(__pyx_v_renders)) {
      __pyx_t_5 = __pyx_v_renders; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_renders); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/display/render.pyx":85
 *         # we need to rebase it.
 *         for k in renders:
 *             if k[2] == old_time:             # <<<<<<<<<<<<<<
 *                 break
 *         else:
 */
      __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_k, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyObject_RichCompare(__pyx_t_6, __pyx_v_old_time, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (__pyx_t_11) {

        /* "renpy/display/render.pyx":86
 *         for k in renders:
 *             if k[2] == old_time:
 *                 break             # <<<<<<<<<<<<<<
 *         else:
 *             continue
 */
        goto __pyx_L6_break;
      }

      /* "renpy/display/render.pyx":84
 *         # Check to see if we have a render with st_base = old_time. If so,
 *         # we need to rebase it.
 *         for k in renders:             # <<<<<<<<<<<<<<
 *             if k[2] == old_time:
 *                 break
 */
    }
    /*else*/ {

      /* "renpy/display/render.pyx":88
 *                 break
 *         else:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         new_renders = { }
 */
      goto __pyx_L8_outer_continue;
    }
    goto __pyx_L6_break;

    /* "renpy/display/render.pyx":84
 *         # Check to see if we have a render with st_base = old_time. If so,
 *         # we need to rebase it.
 *         for k in renders:             # <<<<<<<<<<<<<<
 *             if k[2] == old_time:
 *                 break
 */
    __pyx_L8_outer_continue:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L3_continue;
    __pyx_L6_break:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":90
 *             continue
 * 
 *         new_renders = { }             # <<<<<<<<<<<<<<
 * 
 *         for k, v in renders.iteritems():
 */
    __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_new_renders, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":92
 *         new_renders = { }
 * 
 *         for k, v in renders.iteritems():             # <<<<<<<<<<<<<<
 *             w, h, st_base, at_base = k
 * 
 */
    __pyx_t_8 = 0;
    if (unlikely(__pyx_v_renders == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_renders, 0, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_XDECREF(__pyx_t_5);
    __pyx_t_5 = __pyx_t_10;
    __pyx_t_10 = 0;
    while (1) {
      __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_12, &__pyx_t_8, &__pyx_t_10, &__pyx_t_6, NULL, __pyx_t_7);
      if (unlikely(__pyx_t_13 == 0)) break;
      if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_k, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "renpy/display/render.pyx":93
 * 
 *         for k, v in renders.iteritems():
 *             w, h, st_base, at_base = k             # <<<<<<<<<<<<<<
 * 
 *             if st_base == old_time:
 */
      if ((likely(PyTuple_CheckExact(__pyx_v_k))) || (PyList_CheckExact(__pyx_v_k))) {
        PyObject* sequence = __pyx_v_k;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 4)) {
          if (size > 4) __Pyx_RaiseTooManyValuesError(4);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_15 = PyTuple_GET_ITEM(sequence, 3); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_15 = PyList_GET_ITEM(sequence, 3); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_15);
        #else
        {
          Py_ssize_t i;
          PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_10,&__pyx_t_14,&__pyx_t_15};
          for (i=0; i < 4; i++) {
            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
        }
        #endif
      } else {
        Py_ssize_t index = -1;
        PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_10,&__pyx_t_14,&__pyx_t_15};
        __pyx_t_16 = PyObject_GetIter(__pyx_v_k); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
        for (index=0; index < 4; index++) {
          PyObject* item = __pyx_t_17(__pyx_t_16); if (unlikely(!item)) goto __pyx_L11_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_17 = NULL;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_17 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_st_base, __pyx_t_14);
      __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_at_base, __pyx_t_15);
      __pyx_t_15 = 0;

      /* "renpy/display/render.pyx":95
 *             w, h, st_base, at_base = k
 * 
 *             if st_base == old_time:             # <<<<<<<<<<<<<<
 *                 st_base = new_time
 * 
 */
      __pyx_t_15 = PyObject_RichCompare(__pyx_v_st_base, __pyx_v_old_time, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (__pyx_t_11) {

        /* "renpy/display/render.pyx":96
 * 
 *             if st_base == old_time:
 *                 st_base = new_time             # <<<<<<<<<<<<<<
 * 
 *             if at_base == old_time:
 */
        __Pyx_INCREF(__pyx_v_new_time);
        __Pyx_DECREF_SET(__pyx_v_st_base, __pyx_v_new_time);
        goto __pyx_L13;
      }
      __pyx_L13:;

      /* "renpy/display/render.pyx":98
 *                 st_base = new_time
 * 
 *             if at_base == old_time:             # <<<<<<<<<<<<<<
 *                 at_base = new_time
 * 
 */
      __pyx_t_15 = PyObject_RichCompare(__pyx_v_at_base, __pyx_v_old_time, Py_EQ); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (__pyx_t_11) {

        /* "renpy/display/render.pyx":99
 * 
 *             if at_base == old_time:
 *                 at_base = new_time             # <<<<<<<<<<<<<<
 * 
 *             new_renders[(w, h, st_base, at_base)] = v
 */
        __Pyx_INCREF(__pyx_v_new_time);
        __Pyx_DECREF_SET(__pyx_v_at_base, __pyx_v_new_time);
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "renpy/display/render.pyx":101
 *                 at_base = new_time
 * 
 *             new_renders[(w, h, st_base, at_base)] = v             # <<<<<<<<<<<<<<
 * 
 *         render_cache[id_d] = new_renders
 */
      __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_INCREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      __Pyx_INCREF(__pyx_v_h);
      PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_h);
      __Pyx_GIVEREF(__pyx_v_h);
      __Pyx_INCREF(__pyx_v_st_base);
      PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_st_base);
      __Pyx_GIVEREF(__pyx_v_st_base);
      __Pyx_INCREF(__pyx_v_at_base);
      PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_v_at_base);
      __Pyx_GIVEREF(__pyx_v_at_base);
      if (unlikely(PyDict_SetItem(__pyx_v_new_renders, __pyx_t_15, __pyx_v_v) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":103
 *             new_renders[(w, h, st_base, at_base)] = v
 * 
 *         render_cache[id_d] = new_renders             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_v_id_d, __pyx_v_new_renders) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":74
 * models = False
 * 
 * def adjust_render_cache_times(old_time, new_time):             # <<<<<<<<<<<<<<
 *     """
 *     This adjusts the render cache such that if a render starts at
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("renpy.display.render.adjust_render_cache_times", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_id_d);
  __Pyx_XDECREF(__pyx_v_renders);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_new_renders);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_st_base);
  __Pyx_XDECREF(__pyx_v_at_base);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":106
 * 
 * 
 * def free_memory():             # <<<<<<<<<<<<<<
 *     """
 *     Frees memory used by the render system.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_3free_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_2free_memory[] = "\n    Frees memory used by the render system.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_3free_memory = {"free_memory", (PyCFunction)__pyx_pw_5renpy_7display_6render_3free_memory, METH_NOARGS, __pyx_doc_5renpy_7display_6render_2free_memory};
static PyObject *__pyx_pw_5renpy_7display_6render_3free_memory(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("free_memory (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_2free_memory(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_2free_memory(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("free_memory", 0);

  /* "renpy/display/render.pyx":112
 * 
 *     global screen_render
 *     screen_render = None             # <<<<<<<<<<<<<<
 * 
 *     mark_sweep()
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_screen_render, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":114
 *     screen_render = None
 * 
 *     mark_sweep()             # <<<<<<<<<<<<<<
 * 
 *     render_cache.clear()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_mark_sweep); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":116
 *     mark_sweep()
 * 
 *     render_cache.clear()             # <<<<<<<<<<<<<<
 * 
 *     # This can hang onto a render.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":119
 * 
 *     # This can hang onto a render.
 *     renpy.display.interface.surftree = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_interface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_surftree, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":106
 * 
 * 
 * def free_memory():             # <<<<<<<<<<<<<<
 *     """
 *     Frees memory used by the render system.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.free_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":122
 * 
 * 
 * def check_at_shutdown():             # <<<<<<<<<<<<<<
 *     """
 *     This is called at shutdown time to check that everything went okay.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_5check_at_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_4check_at_shutdown[] = "\n    This is called at shutdown time to check that everything went okay.\n    The big thing it checks for is memory leaks.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_5check_at_shutdown = {"check_at_shutdown", (PyCFunction)__pyx_pw_5renpy_7display_6render_5check_at_shutdown, METH_NOARGS, __pyx_doc_5renpy_7display_6render_4check_at_shutdown};
static PyObject *__pyx_pw_5renpy_7display_6render_5check_at_shutdown(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_at_shutdown (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_4check_at_shutdown(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_4check_at_shutdown(CYTHON_UNUSED PyObject *__pyx_self) {
  CYTHON_UNUSED PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_count = NULL;
  PyObject *__pyx_v_objects = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_at_shutdown", 0);

  /* "renpy/display/render.pyx":128
 *     """
 * 
 *     if not renpy.config.developer:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_developer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "renpy/display/render.pyx":129
 * 
 *     if not renpy.config.developer:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     free_memory()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":131
 *         return
 * 
 *     free_memory()             # <<<<<<<<<<<<<<
 * 
 *     gc.collect()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_free_memory); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":133
 *     free_memory()
 * 
 *     gc.collect()             # <<<<<<<<<<<<<<
 *     l = gc.get_objects()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_collect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":134
 * 
 *     gc.collect()
 *     l = gc.get_objects()             # <<<<<<<<<<<<<<
 * 
 *     count = 0
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_l = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":136
 *     l = gc.get_objects()
 * 
 *     count = 0             # <<<<<<<<<<<<<<
 *     objects = gc.get_objects()
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_count = __pyx_int_0;

  /* "renpy/display/render.pyx":137
 * 
 *     count = 0
 *     objects = gc.get_objects()             # <<<<<<<<<<<<<<
 * 
 *     for i in objects:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_objects = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":139
 *     objects = gc.get_objects()
 * 
 *     for i in objects:             # <<<<<<<<<<<<<<
 *         if isinstance(i, Render):
 *             count += 1
 */
  if (likely(PyList_CheckExact(__pyx_v_objects)) || PyTuple_CheckExact(__pyx_v_objects)) {
    __pyx_t_1 = __pyx_v_objects; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_objects); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":140
 * 
 *     for i in objects:
 *         if isinstance(i, Render):             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_i, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
    __pyx_t_3 = (__pyx_t_4 != 0);
    if (__pyx_t_3) {

      /* "renpy/display/render.pyx":141
 *     for i in objects:
 *         if isinstance(i, Render):
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *     if count:
 */
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_count, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF_SET(__pyx_v_count, __pyx_t_5);
      __pyx_t_5 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "renpy/display/render.pyx":139
 *     objects = gc.get_objects()
 * 
 *     for i in objects:             # <<<<<<<<<<<<<<
 *         if isinstance(i, Render):
 *             count += 1
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":143
 *             count += 1
 * 
 *     if count:             # <<<<<<<<<<<<<<
 *         raise Exception("%d Renders are alive at shutdown. This is probably a memory leak bug in Ren'Py." % count)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_count); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":144
 * 
 *     if count:
 *         raise Exception("%d Renders are alive at shutdown. This is probably a memory leak bug in Ren'Py." % count)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_d_Renders_are_alive_at_shutdown, __pyx_v_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "renpy/display/render.pyx":122
 * 
 * 
 * def check_at_shutdown():             # <<<<<<<<<<<<<<
 *     """
 *     This is called at shutdown time to check that everything went okay.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.display.render.check_at_shutdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_count);
  __Pyx_XDECREF(__pyx_v_objects);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":158
 * render_is_ready = 0
 * 
 * def render_ready():             # <<<<<<<<<<<<<<
 *     global render_is_ready
 *     render_is_ready = 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_7render_ready(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_7render_ready = {"render_ready", (PyCFunction)__pyx_pw_5renpy_7display_6render_7render_ready, METH_NOARGS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_7render_ready(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_ready (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6render_ready(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6render_ready(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_ready", 0);

  /* "renpy/display/render.pyx":160
 * def render_ready():
 *     global render_is_ready
 *     render_is_ready = 1             # <<<<<<<<<<<<<<
 * 
 * # These are good until the next call to render.
 */
  __pyx_v_5renpy_7display_6render_render_is_ready = 1;

  /* "renpy/display/render.pyx":158
 * render_is_ready = 0
 * 
 * def render_ready():             # <<<<<<<<<<<<<<
 *     global render_is_ready
 *     render_is_ready = 1
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":166
 * render_height = 0
 * 
 * cpdef render(d, object widtho, object heighto, double st, double at):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */

static PyObject *__pyx_pw_5renpy_7display_6render_9render(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5renpy_7display_6render_render(PyObject *__pyx_v_d, PyObject *__pyx_v_widtho, PyObject *__pyx_v_heighto, double __pyx_v_st, double __pyx_v_at, CYTHON_UNUSED int __pyx_skip_dispatch) {
  float __pyx_v_width;
  float __pyx_v_height;
  float __pyx_v_orig_width;
  float __pyx_v_orig_height;
  PyObject *__pyx_v_orig_wh = 0;
  PyObject *__pyx_v_wh = 0;
  PyObject *__pyx_v_render_cache_d = 0;
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_rv = 0;
  PyObject *__pyx_v_id_d = NULL;
  PyObject *__pyx_v_style = NULL;
  PyObject *__pyx_v_xmaximum = NULL;
  PyObject *__pyx_v_ymaximum = NULL;
  PyObject *__pyx_v_old_st = NULL;
  PyObject *__pyx_v_old_at = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  float __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  int __pyx_t_20;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render", 0);
  __Pyx_INCREF(__pyx_v_widtho);
  __Pyx_INCREF(__pyx_v_heighto);

  /* "renpy/display/render.pyx":199
 *     cdef Render rv
 * 
 *     if not render_is_ready:             # <<<<<<<<<<<<<<
 *         if renpy.config.developer:
 *             raise Exception("Displayables may not be rendered during the init phase.")
 */
  __pyx_t_1 = ((!(__pyx_v_5renpy_7display_6render_render_is_ready != 0)) != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":200
 * 
 *     if not render_is_ready:
 *         if renpy.config.developer:             # <<<<<<<<<<<<<<
 *             raise Exception("Displayables may not be rendered during the init phase.")
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_developer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":201
 *     if not render_is_ready:
 *         if renpy.config.developer:
 *             raise Exception("Displayables may not be rendered during the init phase.")             # <<<<<<<<<<<<<<
 * 
 *     orig_wh = (widtho, heighto, frame_time-st, frame_time-at)
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":203
 *             raise Exception("Displayables may not be rendered during the init phase.")
 * 
 *     orig_wh = (widtho, heighto, frame_time-st, frame_time-at)             # <<<<<<<<<<<<<<
 * 
 *     render_width = widtho
 */
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_5renpy_7display_6render_frame_time - __pyx_v_st)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5renpy_7display_6render_frame_time - __pyx_v_at)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_widtho);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_widtho);
  __Pyx_GIVEREF(__pyx_v_widtho);
  __Pyx_INCREF(__pyx_v_heighto);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_heighto);
  __Pyx_GIVEREF(__pyx_v_heighto);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_v_orig_wh = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":205
 *     orig_wh = (widtho, heighto, frame_time-st, frame_time-at)
 * 
 *     render_width = widtho             # <<<<<<<<<<<<<<
 *     render_height = heighto
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_width, __pyx_v_widtho) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":206
 * 
 *     render_width = widtho
 *     render_height = heighto             # <<<<<<<<<<<<<<
 * 
 *     id_d = id(d)
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_height, __pyx_v_heighto) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":208
 *     render_height = heighto
 * 
 *     id_d = id(d)             # <<<<<<<<<<<<<<
 *     render_cache_d = render_cache[id_d]
 *     rv = render_cache_d.get(orig_wh, None)
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_id_d = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":209
 * 
 *     id_d = id(d)
 *     render_cache_d = render_cache[id_d]             # <<<<<<<<<<<<<<
 *     rv = render_cache_d.get(orig_wh, None)
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_v_id_d); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_render_cache_d = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":210
 *     id_d = id(d)
 *     render_cache_d = render_cache[id_d]
 *     rv = render_cache_d.get(orig_wh, None)             # <<<<<<<<<<<<<<
 * 
 *     if rv is not None:
 */
  if (unlikely(__pyx_v_render_cache_d == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_render_cache_d, __pyx_v_orig_wh, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_rv = ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":212
 *     rv = render_cache_d.get(orig_wh, None)
 * 
 *     if rv is not None:             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_rv) != Py_None);
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":213
 * 
 *     if rv is not None:
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     orig_width = width = widtho
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_rv));
    __pyx_r = ((PyObject *)__pyx_v_rv);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":215
 *         return rv
 * 
 *     orig_width = width = widtho             # <<<<<<<<<<<<<<
 *     orig_height = height = heighto
 * 
 */
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_widtho); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_orig_width = __pyx_t_6;
  __pyx_v_width = __pyx_t_6;

  /* "renpy/display/render.pyx":216
 * 
 *     orig_width = width = widtho
 *     orig_height = height = heighto             # <<<<<<<<<<<<<<
 * 
 *     style = d.style
 */
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_heighto); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_orig_height = __pyx_t_6;
  __pyx_v_height = __pyx_t_6;

  /* "renpy/display/render.pyx":218
 *     orig_height = height = heighto
 * 
 *     style = d.style             # <<<<<<<<<<<<<<
 *     xmaximum = style.xmaximum
 *     ymaximum = style.ymaximum
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_style); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_style = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":219
 * 
 *     style = d.style
 *     xmaximum = style.xmaximum             # <<<<<<<<<<<<<<
 *     ymaximum = style.ymaximum
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_xmaximum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_xmaximum = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":220
 *     style = d.style
 *     xmaximum = style.xmaximum
 *     ymaximum = style.ymaximum             # <<<<<<<<<<<<<<
 * 
 *     if xmaximum is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_ymaximum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_ymaximum = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":222
 *     ymaximum = style.ymaximum
 * 
 *     if xmaximum is not None:             # <<<<<<<<<<<<<<
 *         if isinstance(xmaximum, float):
 *             width = width * xmaximum
 */
  __pyx_t_5 = (__pyx_v_xmaximum != Py_None);
  __pyx_t_1 = (__pyx_t_5 != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":223
 * 
 *     if xmaximum is not None:
 *         if isinstance(xmaximum, float):             # <<<<<<<<<<<<<<
 *             width = width * xmaximum
 *         else:
 */
    __pyx_t_1 = PyFloat_Check(__pyx_v_xmaximum); 
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "renpy/display/render.pyx":224
 *     if xmaximum is not None:
 *         if isinstance(xmaximum, float):
 *             width = width * xmaximum             # <<<<<<<<<<<<<<
 *         else:
 *             width = min(xmaximum, width)
 */
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_xmaximum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_width = __pyx_t_6;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":226
 *             width = width * xmaximum
 *         else:
 *             width = min(xmaximum, width)             # <<<<<<<<<<<<<<
 * 
 *     if ymaximum is not None:
 */
      __pyx_t_6 = __pyx_v_width;
      __Pyx_INCREF(__pyx_v_xmaximum);
      __pyx_t_3 = __pyx_v_xmaximum;
      __pyx_t_2 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_5) {
        __pyx_t_7 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_4 = __pyx_t_7;
        __pyx_t_7 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = __pyx_t_3;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_width = __pyx_t_6;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "renpy/display/render.pyx":228
 *             width = min(xmaximum, width)
 * 
 *     if ymaximum is not None:             # <<<<<<<<<<<<<<
 *         if isinstance(ymaximum, float):
 *             height = height * ymaximum
 */
  __pyx_t_5 = (__pyx_v_ymaximum != Py_None);
  __pyx_t_1 = (__pyx_t_5 != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":229
 * 
 *     if ymaximum is not None:
 *         if isinstance(ymaximum, float):             # <<<<<<<<<<<<<<
 *             height = height * ymaximum
 *         else:
 */
    __pyx_t_1 = PyFloat_Check(__pyx_v_ymaximum); 
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "renpy/display/render.pyx":230
 *     if ymaximum is not None:
 *         if isinstance(ymaximum, float):
 *             height = height * ymaximum             # <<<<<<<<<<<<<<
 *         else:
 *             height = min(ymaximum, height)
 */
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_v_ymaximum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_height = __pyx_t_6;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":232
 *             height = height * ymaximum
 *         else:
 *             height = min(ymaximum, height)             # <<<<<<<<<<<<<<
 * 
 *     if width < 0:
 */
      __pyx_t_6 = __pyx_v_height;
      __Pyx_INCREF(__pyx_v_ymaximum);
      __pyx_t_3 = __pyx_v_ymaximum;
      __pyx_t_7 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_5) {
        __pyx_t_2 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4 = __pyx_t_2;
        __pyx_t_2 = 0;
      } else {
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = __pyx_t_3;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_height = __pyx_t_6;
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "renpy/display/render.pyx":234
 *             height = min(ymaximum, height)
 * 
 *     if width < 0:             # <<<<<<<<<<<<<<
 *         width = 0
 *     if height < 0:
 */
  __pyx_t_5 = ((__pyx_v_width < 0.0) != 0);
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":235
 * 
 *     if width < 0:
 *         width = 0             # <<<<<<<<<<<<<<
 *     if height < 0:
 *         height = 0
 */
    __pyx_v_width = 0.0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "renpy/display/render.pyx":236
 *     if width < 0:
 *         width = 0
 *     if height < 0:             # <<<<<<<<<<<<<<
 *         height = 0
 * 
 */
  __pyx_t_5 = ((__pyx_v_height < 0.0) != 0);
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":237
 *         width = 0
 *     if height < 0:
 *         height = 0             # <<<<<<<<<<<<<<
 * 
 *     if orig_width != width or orig_height != height:
 */
    __pyx_v_height = 0.0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "renpy/display/render.pyx":239
 *         height = 0
 * 
 *     if orig_width != width or orig_height != height:             # <<<<<<<<<<<<<<
 *         widtho = width
 *         heighto = height
 */
  __pyx_t_1 = ((__pyx_v_orig_width != __pyx_v_width) != 0);
  if (!__pyx_t_1) {
  } else {
    __pyx_t_5 = __pyx_t_1;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_1 = ((__pyx_v_orig_height != __pyx_v_height) != 0);
  __pyx_t_5 = __pyx_t_1;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":240
 * 
 *     if orig_width != width or orig_height != height:
 *         widtho = width             # <<<<<<<<<<<<<<
 *         heighto = height
 *         wh = (widtho, heighto, frame_time-st, frame_time-at)
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_widtho, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":241
 *     if orig_width != width or orig_height != height:
 *         widtho = width
 *         heighto = height             # <<<<<<<<<<<<<<
 *         wh = (widtho, heighto, frame_time-st, frame_time-at)
 *         rv = render_cache_d.get(wh, None)
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF_SET(__pyx_v_heighto, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":242
 *         widtho = width
 *         heighto = height
 *         wh = (widtho, heighto, frame_time-st, frame_time-at)             # <<<<<<<<<<<<<<
 *         rv = render_cache_d.get(wh, None)
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble((__pyx_v_5renpy_7display_6render_frame_time - __pyx_v_st)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5renpy_7display_6render_frame_time - __pyx_v_at)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_widtho);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_widtho);
    __Pyx_GIVEREF(__pyx_v_widtho);
    __Pyx_INCREF(__pyx_v_heighto);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_heighto);
    __Pyx_GIVEREF(__pyx_v_heighto);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_v_wh = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":243
 *         heighto = height
 *         wh = (widtho, heighto, frame_time-st, frame_time-at)
 *         rv = render_cache_d.get(wh, None)             # <<<<<<<<<<<<<<
 * 
 *         if rv is not None:
 */
    if (unlikely(__pyx_v_render_cache_d == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_render_cache_d, __pyx_v_wh, Py_None); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":245
 *         rv = render_cache_d.get(wh, None)
 * 
 *         if rv is not None:             # <<<<<<<<<<<<<<
 *             return rv
 * 
 */
    __pyx_t_5 = (((PyObject *)__pyx_v_rv) != Py_None);
    __pyx_t_1 = (__pyx_t_5 != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":246
 * 
 *         if rv is not None:
 *             return rv             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(((PyObject *)__pyx_v_rv));
      __pyx_r = ((PyObject *)__pyx_v_rv);
      goto __pyx_L0;
    }
    goto __pyx_L12;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":249
 * 
 *     else:
 *         wh = orig_wh             # <<<<<<<<<<<<<<
 * 
 *     renpy.plog(2, "start render {!r}", d)
 */
    __Pyx_INCREF(__pyx_v_orig_wh);
    __pyx_v_wh = __pyx_v_orig_wh;
  }
  __pyx_L12:;

  /* "renpy/display/render.pyx":251
 *         wh = orig_wh
 * 
 *     renpy.plog(2, "start render {!r}", d)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_plog); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_3) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_INCREF(__pyx_kp_s_start_render_r);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_kp_s_start_render_r);
  __Pyx_GIVEREF(__pyx_kp_s_start_render_r);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":253
 *     renpy.plog(2, "start render {!r}", d)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         rendering += 1
 *         old_st = render_st
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":254
 * 
 *     try:
 *         rendering += 1             # <<<<<<<<<<<<<<
 *         old_st = render_st
 *         old_at = render_at
 */
    __pyx_v_5renpy_7display_6render_rendering = (__pyx_v_5renpy_7display_6render_rendering + 1);

    /* "renpy/display/render.pyx":255
 *     try:
 *         rendering += 1
 *         old_st = render_st             # <<<<<<<<<<<<<<
 *         old_at = render_at
 *         render_st = st
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_st); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_old_st = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":256
 *         rendering += 1
 *         old_st = render_st
 *         old_at = render_at             # <<<<<<<<<<<<<<
 *         render_st = st
 *         render_at = at
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_old_at = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":257
 *         old_st = render_st
 *         old_at = render_at
 *         render_st = st             # <<<<<<<<<<<<<<
 *         render_at = at
 *         rv = d.render(widtho, heighto, st, at)
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_st, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":258
 *         old_at = render_at
 *         render_st = st
 *         render_at = at             # <<<<<<<<<<<<<<
 *         rv = d.render(widtho, heighto, st, at)
 *     finally:
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_at); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_at, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":259
 *         render_st = st
 *         render_at = at
 *         rv = d.render(widtho, heighto, st, at)             # <<<<<<<<<<<<<<
 *     finally:
 *         rendering -= 1
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = PyFloat_FromDouble(__pyx_v_st); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_at); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_10 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (__pyx_t_9) {
      PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_widtho);
    PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_widtho);
    __Pyx_GIVEREF(__pyx_v_widtho);
    __Pyx_INCREF(__pyx_v_heighto);
    PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_v_heighto);
    __Pyx_GIVEREF(__pyx_v_heighto);
    PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_8, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_8, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_7 = 0;
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L17_error;}
    __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_2));
    __pyx_t_2 = 0;
  }

  /* "renpy/display/render.pyx":261
 *         rv = d.render(widtho, heighto, st, at)
 *     finally:
 *         rendering -= 1             # <<<<<<<<<<<<<<
 *         render_st = old_st
 *         render_at = old_at
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_v_5renpy_7display_6render_rendering = (__pyx_v_5renpy_7display_6render_rendering - 1);

      /* "renpy/display/render.pyx":262
 *     finally:
 *         rendering -= 1
 *         render_st = old_st             # <<<<<<<<<<<<<<
 *         render_at = old_at
 * 
 */
      if (unlikely(!__pyx_v_old_st)) { __Pyx_RaiseUnboundLocalError("old_st"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_st, __pyx_v_old_st) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "renpy/display/render.pyx":263
 *         rendering -= 1
 *         render_st = old_st
 *         render_at = old_at             # <<<<<<<<<<<<<<
 * 
 *     if rv.__class__ is not Render:
 */
      if (unlikely(!__pyx_v_old_at)) { __Pyx_RaiseUnboundLocalError("old_at"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_at, __pyx_v_old_at) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L18;
    }
    /*exception exit:*/{
      __pyx_L17_error:;
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
      {

        /* "renpy/display/render.pyx":261
 *         rv = d.render(widtho, heighto, st, at)
 *     finally:
 *         rendering -= 1             # <<<<<<<<<<<<<<
 *         render_st = old_st
 *         render_at = old_at
 */
        __pyx_v_5renpy_7display_6render_rendering = (__pyx_v_5renpy_7display_6render_rendering - 1);

        /* "renpy/display/render.pyx":262
 *     finally:
 *         rendering -= 1
 *         render_st = old_st             # <<<<<<<<<<<<<<
 *         render_at = old_at
 * 
 */
        if (unlikely(!__pyx_v_old_st)) { __Pyx_RaiseUnboundLocalError("old_st"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L20_error;} }
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_st, __pyx_v_old_st) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L20_error;}

        /* "renpy/display/render.pyx":263
 *         rendering -= 1
 *         render_st = old_st
 *         render_at = old_at             # <<<<<<<<<<<<<<
 * 
 *     if rv.__class__ is not Render:
 */
        if (unlikely(!__pyx_v_old_at)) { __Pyx_RaiseUnboundLocalError("old_at"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L20_error;} }
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_at, __pyx_v_old_at) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
      }
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_XGIVEREF(__pyx_t_16);
      __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
      goto __pyx_L1_error;
      __pyx_L20_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_XGIVEREF(__pyx_t_19);
        __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
      }
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L18:;
  }

  /* "renpy/display/render.pyx":265
 *         render_at = old_at
 * 
 *     if rv.__class__ is not Render:             # <<<<<<<<<<<<<<
 *         raise Exception("{!r}.render() must return a Render.".format(d))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = (__pyx_t_2 != ((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":266
 * 
 *     if rv.__class__ is not Render:
 *         raise Exception("{!r}.render() must return a Render.".format(d))             # <<<<<<<<<<<<<<
 * 
 *     rv.render_of.append(d)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_r_render_must_return_a_Render, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_10) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
      __Pyx_INCREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "renpy/display/render.pyx":268
 *         raise Exception("{!r}.render() must return a Render.".format(d))
 * 
 *     rv.render_of.append(d)             # <<<<<<<<<<<<<<
 * 
 *     if d._clipping:
 */
  __pyx_t_20 = __Pyx_PyObject_Append(__pyx_v_rv->render_of, __pyx_v_d); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":270
 *     rv.render_of.append(d)
 * 
 *     if d._clipping:             # <<<<<<<<<<<<<<
 *         renpy.plog(4, "before clipping")
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_clipping); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":271
 * 
 *     if d._clipping:
 *         renpy.plog(4, "before clipping")             # <<<<<<<<<<<<<<
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 *         rv.render_of.append(d)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_plog); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "renpy/display/render.pyx":272
 *     if d._clipping:
 *         renpy.plog(4, "before clipping")
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)             # <<<<<<<<<<<<<<
 *         rv.render_of.append(d)
 *         renpy.plog(4, "after clipping")
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_subsurface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_rv->width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_rv->height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_4 = 0;
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __pyx_t_10 = 0;
    __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_focus, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_rv, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":273
 *         renpy.plog(4, "before clipping")
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 *         rv.render_of.append(d)             # <<<<<<<<<<<<<<
 *         renpy.plog(4, "after clipping")
 * 
 */
    __pyx_t_20 = __Pyx_PyObject_Append(__pyx_v_rv->render_of, __pyx_v_d); if (unlikely(__pyx_t_20 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":274
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 *         rv.render_of.append(d)
 *         renpy.plog(4, "after clipping")             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_plog); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L22;
  }
  __pyx_L22:;

  /* "renpy/display/render.pyx":277
 * 
 * 
 *     if not sizing:             # <<<<<<<<<<<<<<
 * 
 *         # This lookup is needed because invalidations are possible.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sizing); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = ((!__pyx_t_5) != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":280
 * 
 *         # This lookup is needed because invalidations are possible.
 *         render_cache_d = render_cache[id_d]             # <<<<<<<<<<<<<<
 *         render_cache_d[wh] = rv
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_id_d); if (unlikely(__pyx_t_10 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyDict_CheckExact(__pyx_t_10))||((__pyx_t_10) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_10)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_render_cache_d, ((PyObject*)__pyx_t_10));
    __pyx_t_10 = 0;

    /* "renpy/display/render.pyx":281
 *         # This lookup is needed because invalidations are possible.
 *         render_cache_d = render_cache[id_d]
 *         render_cache_d[wh] = rv             # <<<<<<<<<<<<<<
 * 
 *         if wh is not orig_wh:
 */
    if (unlikely(__pyx_v_render_cache_d == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    if (unlikely(PyDict_SetItem(__pyx_v_render_cache_d, __pyx_v_wh, ((PyObject *)__pyx_v_rv)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":283
 *         render_cache_d[wh] = rv
 * 
 *         if wh is not orig_wh:             # <<<<<<<<<<<<<<
 *             render_cache_d[orig_wh] = rv
 * 
 */
    __pyx_t_1 = (__pyx_v_wh != __pyx_v_orig_wh);
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

      /* "renpy/display/render.pyx":284
 * 
 *         if wh is not orig_wh:
 *             render_cache_d[orig_wh] = rv             # <<<<<<<<<<<<<<
 * 
 *     renpy.plog(2, "end render {!r}", d)
 */
      if (unlikely(__pyx_v_render_cache_d == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      if (unlikely(PyDict_SetItem(__pyx_v_render_cache_d, __pyx_v_orig_wh, ((PyObject *)__pyx_v_rv)) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L24;
    }
    __pyx_L24:;
    goto __pyx_L23;
  }
  __pyx_L23:;

  /* "renpy/display/render.pyx":286
 *             render_cache_d[orig_wh] = rv
 * 
 *     renpy.plog(2, "end render {!r}", d)             # <<<<<<<<<<<<<<
 * 
 *     return rv
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_plog); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_int_2);
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  __Pyx_INCREF(__pyx_kp_s_end_render_r);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_kp_s_end_render_r);
  __Pyx_GIVEREF(__pyx_kp_s_end_render_r);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_2, 2+__pyx_t_8, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "renpy/display/render.pyx":288
 *     renpy.plog(2, "end render {!r}", d)
 * 
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * def render_for_size(d, width, height, st, at):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rv));
  __pyx_r = ((PyObject *)__pyx_v_rv);
  goto __pyx_L0;

  /* "renpy/display/render.pyx":166
 * render_height = 0
 * 
 * cpdef render(d, object widtho, object heighto, double st, double at):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("renpy.display.render.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_orig_wh);
  __Pyx_XDECREF(__pyx_v_wh);
  __Pyx_XDECREF(__pyx_v_render_cache_d);
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_id_d);
  __Pyx_XDECREF(__pyx_v_style);
  __Pyx_XDECREF(__pyx_v_xmaximum);
  __Pyx_XDECREF(__pyx_v_ymaximum);
  __Pyx_XDECREF(__pyx_v_old_st);
  __Pyx_XDECREF(__pyx_v_old_at);
  __Pyx_XDECREF(__pyx_v_widtho);
  __Pyx_XDECREF(__pyx_v_heighto);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_9render(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_8render[] = "\n    :doc: udd_utility\n    :args: (d, width, height, st, at)\n\n    Causes a displayable to be rendered, and a renpy.Render object to\n    be returned.\n\n    `d`\n        The displayable to render.\n\n    `width`, `height`\n        The width and height available for the displayable to render into.\n\n    `st`, `at`\n        The shown and animation timebases.\n\n    Renders returned by this object may be cached, and should not be modified\n    once they have been retrieved.\n    ";
static PyObject *__pyx_pw_5renpy_7display_6render_9render(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_widtho = 0;
  PyObject *__pyx_v_heighto = 0;
  double __pyx_v_st;
  double __pyx_v_at;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_widtho,&__pyx_n_s_heighto,&__pyx_n_s_st,&__pyx_n_s_at,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_widtho)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_heighto)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_st)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_at)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_d = values[0];
    __pyx_v_widtho = values[1];
    __pyx_v_heighto = values[2];
    __pyx_v_st = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_st == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_at = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_at == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_8render(__pyx_self, __pyx_v_d, __pyx_v_widtho, __pyx_v_heighto, __pyx_v_st, __pyx_v_at);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_8render(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_widtho, PyObject *__pyx_v_heighto, double __pyx_v_st, double __pyx_v_at) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_5renpy_7display_6render_render(__pyx_v_d, __pyx_v_widtho, __pyx_v_heighto, __pyx_v_st, __pyx_v_at, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":290
 *     return rv
 * 
 * def render_for_size(d, width, height, st, at):             # <<<<<<<<<<<<<<
 *     """
 *     This returns a render of `d`  that's useful for getting the size or
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_11render_for_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_10render_for_size[] = "\n    This returns a render of `d`  that's useful for getting the size or\n    screen location, but not for actual rendering.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_11render_for_size = {"render_for_size", (PyCFunction)__pyx_pw_5renpy_7display_6render_11render_for_size, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_10render_for_size};
static PyObject *__pyx_pw_5renpy_7display_6render_11render_for_size(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_st = 0;
  PyObject *__pyx_v_at = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_for_size (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_st,&__pyx_n_s_at,0};
    PyObject* values[5] = {0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_for_size", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_for_size", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_st)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_for_size", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_at)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_for_size", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render_for_size") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
    }
    __pyx_v_d = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_st = values[3];
    __pyx_v_at = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_for_size", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.render_for_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_10render_for_size(__pyx_self, __pyx_v_d, __pyx_v_width, __pyx_v_height, __pyx_v_st, __pyx_v_at);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_10render_for_size(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_st, PyObject *__pyx_v_at) {
  PyObject *__pyx_v_id_d = NULL;
  PyObject *__pyx_v_orig_wh = NULL;
  PyObject *__pyx_v_render_cache_d = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_v_old_sizing = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  double __pyx_t_8;
  double __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  char const *__pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_for_size", 0);

  /* "renpy/display/render.pyx":298
 *     global sizing
 * 
 *     id_d = id(d)             # <<<<<<<<<<<<<<
 *     orig_wh = (width, height, frame_time-st, frame_time-at)
 *     render_cache_d = render_cache[id_d]
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_id_d = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":299
 * 
 *     id_d = id(d)
 *     orig_wh = (width, height, frame_time-st, frame_time-at)             # <<<<<<<<<<<<<<
 *     render_cache_d = render_cache[id_d]
 *     rv = render_cache_d.get(orig_wh, None)
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_5renpy_7display_6render_frame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_st); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_5renpy_7display_6render_frame_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_at); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_v_orig_wh = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":300
 *     id_d = id(d)
 *     orig_wh = (width, height, frame_time-st, frame_time-at)
 *     render_cache_d = render_cache[id_d]             # <<<<<<<<<<<<<<
 *     rv = render_cache_d.get(orig_wh, None)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetItem(__pyx_t_2, __pyx_v_id_d); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_render_cache_d = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":301
 *     orig_wh = (width, height, frame_time-st, frame_time-at)
 *     render_cache_d = render_cache[id_d]
 *     rv = render_cache_d.get(orig_wh, None)             # <<<<<<<<<<<<<<
 * 
 *     if rv is not None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_render_cache_d, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_1) {
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
  }
  __Pyx_INCREF(__pyx_v_orig_wh);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_orig_wh);
  __Pyx_GIVEREF(__pyx_v_orig_wh);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_rv = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":303
 *     rv = render_cache_d.get(orig_wh, None)
 * 
 *     if rv is not None:             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_t_6 = (__pyx_v_rv != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "renpy/display/render.pyx":304
 * 
 *     if rv is not None:
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     old_sizing = sizing
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_rv);
    __pyx_r = __pyx_v_rv;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":306
 *         return rv
 * 
 *     old_sizing = sizing             # <<<<<<<<<<<<<<
 *     sizing = True
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sizing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_old_sizing = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":307
 * 
 *     old_sizing = sizing
 *     sizing = True             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizing, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":309
 *     sizing = True
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         return render(d, width, height, st, at)
 *     finally:
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":310
 * 
 *     try:
 *         return render(d, width, height, st, at)             # <<<<<<<<<<<<<<
 *     finally:
 *         sizing = old_sizing
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_at); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __pyx_t_3 = __pyx_f_5renpy_7display_6render_render(__pyx_v_d, __pyx_v_width, __pyx_v_height, __pyx_t_8, __pyx_t_9, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L4_return;
  }

  /* "renpy/display/render.pyx":312
 *         return render(d, width, height, st, at)
 *     finally:
 *         sizing = old_sizing             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*exception exit:*/{
      __pyx_L5_error:;
      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15) < 0)) __Pyx_ErrFetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __pyx_t_10 = __pyx_lineno; __pyx_t_11 = __pyx_clineno; __pyx_t_12 = __pyx_filename;
      {
        if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizing, __pyx_v_old_sizing) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_XGIVEREF(__pyx_t_15);
      __Pyx_ErrRestore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
      __pyx_lineno = __pyx_t_10; __pyx_clineno = __pyx_t_11; __pyx_filename = __pyx_t_12;
      goto __pyx_L1_error;
      __pyx_L8_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_XGIVEREF(__pyx_t_18);
        __Pyx_ExceptionReset(__pyx_t_16, __pyx_t_17, __pyx_t_18);
      }
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_18 = __pyx_r;
      __pyx_r = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizing, __pyx_v_old_sizing) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_r = __pyx_t_18;
      __pyx_t_18 = 0;
      goto __pyx_L0;
    }
  }

  /* "renpy/display/render.pyx":290
 *     return rv
 * 
 * def render_for_size(d, width, height, st, at):             # <<<<<<<<<<<<<<
 *     """
 *     This returns a render of `d`  that's useful for getting the size or
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.display.render.render_for_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_id_d);
  __Pyx_XDECREF(__pyx_v_orig_wh);
  __Pyx_XDECREF(__pyx_v_render_cache_d);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_old_sizing);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":315
 * 
 * 
 * def invalidate(d):             # <<<<<<<<<<<<<<
 *     """
 *     Removes d from the render cache. If we're not in a redraw, triggers
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_13invalidate(PyObject *__pyx_self, PyObject *__pyx_v_d); /*proto*/
static char __pyx_doc_5renpy_7display_6render_12invalidate[] = "\n    Removes d from the render cache. If we're not in a redraw, triggers\n    a redraw to start.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_13invalidate = {"invalidate", (PyCFunction)__pyx_pw_5renpy_7display_6render_13invalidate, METH_O, __pyx_doc_5renpy_7display_6render_12invalidate};
static PyObject *__pyx_pw_5renpy_7display_6render_13invalidate(PyObject *__pyx_self, PyObject *__pyx_v_d) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("invalidate (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_12invalidate(__pyx_self, ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_12invalidate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d) {
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("invalidate", 0);

  /* "renpy/display/render.pyx":321
 *     """
 * 
 *     if (not rendering) and (not per_frame) and (not sizing):             # <<<<<<<<<<<<<<
 *         redraw(d, 0)
 *         return
 */
  __pyx_t_2 = ((!(__pyx_v_5renpy_7display_6render_rendering != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_per_frame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = ((!__pyx_t_2) != 0);
  if (__pyx_t_4) {
  } else {
    __pyx_t_1 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sizing); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = ((!__pyx_t_4) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":322
 * 
 *     if (not rendering) and (not per_frame) and (not sizing):
 *         redraw(d, 0)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_7 = 1;
      }
    }
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":323
 *     if (not rendering) and (not per_frame) and (not sizing):
 *         redraw(d, 0)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     for v in render_cache[id(d)].values():
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":325
 *         return
 * 
 *     for v in render_cache[id(d)].values():             # <<<<<<<<<<<<<<
 *         v.kill_cache()
 * 
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (__pyx_t_8) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_6);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":326
 * 
 *     for v in render_cache[id(d)].values():
 *         v.kill_cache()             # <<<<<<<<<<<<<<
 * 
 * def check_redraws():
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_kill_cache); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":325
 *         return
 * 
 *     for v in render_cache[id(d)].values():             # <<<<<<<<<<<<<<
 *         v.kill_cache()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/display/render.pyx":315
 * 
 * 
 * def invalidate(d):             # <<<<<<<<<<<<<<
 *     """
 *     Removes d from the render cache. If we're not in a redraw, triggers
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("renpy.display.render.invalidate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":328
 *         v.kill_cache()
 * 
 * def check_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Returns true if a redraw is required, and False otherwise.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_15check_redraws(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_14check_redraws[] = "\n    Returns true if a redraw is required, and False otherwise.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_15check_redraws = {"check_redraws", (PyCFunction)__pyx_pw_5renpy_7display_6render_15check_redraws, METH_NOARGS, __pyx_doc_5renpy_7display_6render_14check_redraws};
static PyObject *__pyx_pw_5renpy_7display_6render_15check_redraws(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check_redraws (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_14check_redraws(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_14check_redraws(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_now = NULL;
  PyObject *__pyx_v_when = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_id_d = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check_redraws", 0);

  /* "renpy/display/render.pyx":333
 *     """
 * 
 *     redraw_queue.sort()             # <<<<<<<<<<<<<<
 * 
 *     now = renpy.display.core.get_time()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":335
 *     redraw_queue.sort()
 * 
 *     now = renpy.display.core.get_time()             # <<<<<<<<<<<<<<
 * 
 *     for when, d in redraw_queue:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":337
 *     now = renpy.display.core.get_time()
 * 
 *     for when, d in redraw_queue:             # <<<<<<<<<<<<<<
 * 
 *         id_d = id(d)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_when, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "renpy/display/render.pyx":339
 *     for when, d in redraw_queue:
 * 
 *         id_d = id(d)             # <<<<<<<<<<<<<<
 * 
 *         if id_d not in render_cache:
 */
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_id_d, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "renpy/display/render.pyx":341
 *         id_d = id(d)
 * 
 *         if id_d not in render_cache:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_id_d, __pyx_t_6, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = (__pyx_t_9 != 0);
    if (__pyx_t_10) {

      /* "renpy/display/render.pyx":342
 * 
 *         if id_d not in render_cache:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if when <= now:
 */
      goto __pyx_L3_continue;
    }

    /* "renpy/display/render.pyx":344
 *             continue
 * 
 *         if when <= now:             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_when, __pyx_v_now, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_10) {

      /* "renpy/display/render.pyx":345
 * 
 *         if when <= now:
 *             return True             # <<<<<<<<<<<<<<
 * 
 *     return False
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }

    /* "renpy/display/render.pyx":337
 *     now = renpy.display.core.get_time()
 * 
 *     for when, d in redraw_queue:             # <<<<<<<<<<<<<<
 * 
 *         id_d = id(d)
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":347
 *             return True
 * 
 *     return False             # <<<<<<<<<<<<<<
 * 
 * def process_redraws():
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":328
 *         v.kill_cache()
 * 
 * def check_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Returns true if a redraw is required, and False otherwise.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.check_redraws", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_when);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_id_d);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":349
 *     return False
 * 
 * def process_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Removes any pending redraws from the redraw queue.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_17process_redraws(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_16process_redraws[] = "\n    Removes any pending redraws from the redraw queue.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_17process_redraws = {"process_redraws", (PyCFunction)__pyx_pw_5renpy_7display_6render_17process_redraws, METH_NOARGS, __pyx_doc_5renpy_7display_6render_16process_redraws};
static PyObject *__pyx_pw_5renpy_7display_6render_17process_redraws(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("process_redraws (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_16process_redraws(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_16process_redraws(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_now = NULL;
  int __pyx_v_rv;
  PyObject *__pyx_v_new_redraw_queue = NULL;
  PyObject *__pyx_v_seen = NULL;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_v_when = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_id_d = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("process_redraws", 0);

  /* "renpy/display/render.pyx":356
 *     global redraw_queue
 * 
 *     redraw_queue.sort()             # <<<<<<<<<<<<<<
 * 
 *     now = renpy.display.core.get_time()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":358
 *     redraw_queue.sort()
 * 
 *     now = renpy.display.core.get_time()             # <<<<<<<<<<<<<<
 *     rv = False
 * 
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_now = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":359
 * 
 *     now = renpy.display.core.get_time()
 *     rv = False             # <<<<<<<<<<<<<<
 * 
 *     new_redraw_queue = [ ]
 */
  __pyx_v_rv = 0;

  /* "renpy/display/render.pyx":361
 *     rv = False
 * 
 *     new_redraw_queue = [ ]             # <<<<<<<<<<<<<<
 *     seen = set()
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_redraw_queue = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":362
 * 
 *     new_redraw_queue = [ ]
 *     seen = set()             # <<<<<<<<<<<<<<
 * 
 *     for t in redraw_queue:
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_seen = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":364
 *     seen = set()
 * 
 *     for t in redraw_queue:             # <<<<<<<<<<<<<<
 *         when, d = t
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":365
 * 
 *     for t in redraw_queue:
 *         when, d = t             # <<<<<<<<<<<<<<
 * 
 *         id_d = id(d)
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_t))) || (PyList_CheckExact(__pyx_v_t))) {
      PyObject* sequence = __pyx_v_t;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_when, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":367
 *         when, d = t
 * 
 *         id_d = id(d)             # <<<<<<<<<<<<<<
 * 
 *         if id_d in seen:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_id_d, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":369
 *         id_d = id(d)
 * 
 *         if id_d in seen:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_v_id_d, __pyx_v_seen, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = (__pyx_t_8 != 0);
    if (__pyx_t_9) {

      /* "renpy/display/render.pyx":370
 * 
 *         if id_d in seen:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         seen.add(id_d)
 */
      goto __pyx_L3_continue;
    }

    /* "renpy/display/render.pyx":372
 *             continue
 * 
 *         seen.add(id_d)             # <<<<<<<<<<<<<<
 * 
 *         if id_d not in render_cache:
 */
    __pyx_t_10 = PySet_Add(__pyx_v_seen, __pyx_v_id_d); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":374
 *         seen.add(id_d)
 * 
 *         if id_d not in render_cache:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_v_id_d, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = (__pyx_t_9 != 0);
    if (__pyx_t_8) {

      /* "renpy/display/render.pyx":375
 * 
 *         if id_d not in render_cache:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         if when <= now:
 */
      goto __pyx_L3_continue;
    }

    /* "renpy/display/render.pyx":377
 *             continue
 * 
 *         if when <= now:             # <<<<<<<<<<<<<<
 * 
 *             # Remove this displayable and all its parents from the
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_when, __pyx_v_now, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {

      /* "renpy/display/render.pyx":383
 *             # children that we want to reuse.
 * 
 *             for v in render_cache[id_d].values():             # <<<<<<<<<<<<<<
 *                 v.kill_cache()
 * 
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_id_d); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_values); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
        __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
      } else {
        __pyx_t_11 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      for (;;) {
        if (likely(!__pyx_t_12)) {
          if (likely(PyList_CheckExact(__pyx_t_3))) {
            if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          } else {
            if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #else
            __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            #endif
          }
        } else {
          __pyx_t_1 = __pyx_t_12(__pyx_t_3);
          if (unlikely(!__pyx_t_1)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "renpy/display/render.pyx":384
 * 
 *             for v in render_cache[id_d].values():
 *                 v.kill_cache()             # <<<<<<<<<<<<<<
 * 
 *             rv = True
 */
        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_v, __pyx_n_s_kill_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_6, function);
          }
        }
        if (__pyx_t_13) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "renpy/display/render.pyx":383
 *             # children that we want to reuse.
 * 
 *             for v in render_cache[id_d].values():             # <<<<<<<<<<<<<<
 *                 v.kill_cache()
 * 
 */
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "renpy/display/render.pyx":386
 *                 v.kill_cache()
 * 
 *             rv = True             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_v_rv = 1;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":389
 * 
 *         else:
 *             new_redraw_queue.append(t)             # <<<<<<<<<<<<<<
 * 
 *     redraw_queue = new_redraw_queue
 */
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_redraw_queue, __pyx_v_t); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L9:;

    /* "renpy/display/render.pyx":364
 *     seen = set()
 * 
 *     for t in redraw_queue:             # <<<<<<<<<<<<<<
 *         when, d = t
 * 
 */
    __pyx_L3_continue:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":391
 *             new_redraw_queue.append(t)
 * 
 *     redraw_queue = new_redraw_queue             # <<<<<<<<<<<<<<
 * 
 *     return rv
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_redraw_queue, __pyx_v_new_redraw_queue) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":393
 *     redraw_queue = new_redraw_queue
 * 
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_rv); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":349
 *     return False
 * 
 * def process_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Removes any pending redraws from the redraw queue.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("renpy.display.render.process_redraws", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_now);
  __Pyx_XDECREF(__pyx_v_new_redraw_queue);
  __Pyx_XDECREF(__pyx_v_seen);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XDECREF(__pyx_v_when);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_id_d);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":396
 * 
 * 
 * def redraw_time():             # <<<<<<<<<<<<<<
 *     """
 *     Returns the time at which the next redraw is scheduled.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_19redraw_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_18redraw_time[] = "\n    Returns the time at which the next redraw is scheduled.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_19redraw_time = {"redraw_time", (PyCFunction)__pyx_pw_5renpy_7display_6render_19redraw_time, METH_NOARGS, __pyx_doc_5renpy_7display_6render_18redraw_time};
static PyObject *__pyx_pw_5renpy_7display_6render_19redraw_time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw_time (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_18redraw_time(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_18redraw_time(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("redraw_time", 0);

  /* "renpy/display/render.pyx":401
 *     """
 * 
 *     if redraw_queue:             # <<<<<<<<<<<<<<
 *         return redraw_queue[0][0]
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":402
 * 
 *     if redraw_queue:
 *         return redraw_queue[0][0]             # <<<<<<<<<<<<<<
 * 
 *     return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":404
 *         return redraw_queue[0][0]
 * 
 *     return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":396
 * 
 * 
 * def redraw_time():             # <<<<<<<<<<<<<<
 *     """
 *     Returns the time at which the next redraw is scheduled.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.redraw_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":407
 * 
 * 
 * def redraw(d, when):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_21redraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_20redraw[] = "\n    :doc: udd_utility\n\n    Causes the displayable `d` to be redrawn after `when` seconds have\n    elapsed.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_21redraw = {"redraw", (PyCFunction)__pyx_pw_5renpy_7display_6render_21redraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_20redraw};
static PyObject *__pyx_pw_5renpy_7display_6render_21redraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_when = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_when,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_when)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("redraw", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "redraw") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_d = values[0];
    __pyx_v_when = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("redraw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_20redraw(__pyx_self, __pyx_v_d, __pyx_v_when);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_20redraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_when) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("redraw", 0);

  /* "renpy/display/render.pyx":415
 *     """
 * 
 *     if not renpy.game.interface:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_game); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "renpy/display/render.pyx":416
 * 
 *     if not renpy.game.interface:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     if per_frame:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":418
 *         return
 * 
 *     if per_frame:             # <<<<<<<<<<<<<<
 *         invalidate(d)
 *         return
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_per_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "renpy/display/render.pyx":419
 * 
 *     if per_frame:
 *         invalidate(d)             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_invalidate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":420
 *     if per_frame:
 *         invalidate(d)
 *         return             # <<<<<<<<<<<<<<
 * 
 *     redraw_queue.append((when + renpy.game.interface.frame_time, d))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":422
 *         return
 * 
 *     redraw_queue.append((when + renpy.game.interface.frame_time, d))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_redraw_queue); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_game); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_interface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_frame_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_when, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_6); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "renpy/display/render.pyx":407
 * 
 * 
 * def redraw(d, when):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("renpy.display.render.redraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":431
 * 
 * 
 * def take_focuses(focuses):             # <<<<<<<<<<<<<<
 *     """
 *     Adds a list of rectangular focus regions to the focuses list.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_23take_focuses(PyObject *__pyx_self, PyObject *__pyx_v_focuses); /*proto*/
static char __pyx_doc_5renpy_7display_6render_22take_focuses[] = "\n    Adds a list of rectangular focus regions to the focuses list.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_23take_focuses = {"take_focuses", (PyCFunction)__pyx_pw_5renpy_7display_6render_23take_focuses, METH_O, __pyx_doc_5renpy_7display_6render_22take_focuses};
static PyObject *__pyx_pw_5renpy_7display_6render_23take_focuses(PyObject *__pyx_self, PyObject *__pyx_v_focuses) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_focuses (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_22take_focuses(__pyx_self, ((PyObject *)__pyx_v_focuses));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_22take_focuses(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_focuses) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_focuses", 0);

  /* "renpy/display/render.pyx":436
 *     """
 * 
 *     screen_render.take_focuses(             # <<<<<<<<<<<<<<
 *         0, 0, screen_render.width, screen_render.height,
 *         IDENTITY,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_take_focuses); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":437
 * 
 *     screen_render.take_focuses(
 *         0, 0, screen_render.width, screen_render.height,             # <<<<<<<<<<<<<<
 *         IDENTITY,
 *         0, 0,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_height); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":438
 *     screen_render.take_focuses(
 *         0, 0, screen_render.width, screen_render.height,
 *         IDENTITY,             # <<<<<<<<<<<<<<
 *         0, 0,
 *         None,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_IDENTITY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "renpy/display/render.pyx":441
 *         0, 0,
 *         None,
 *         focuses)             # <<<<<<<<<<<<<<
 * 
 * # The result of focus_at_point for a modal render. This overrides any
 */
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(9+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_6) {
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_7, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(__pyx_v_focuses);
  PyTuple_SET_ITEM(__pyx_t_8, 8+__pyx_t_7, __pyx_v_focuses);
  __Pyx_GIVEREF(__pyx_v_focuses);
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":431
 * 
 * 
 * def take_focuses(focuses):             # <<<<<<<<<<<<<<
 *     """
 *     Adds a list of rectangular focus regions to the focuses list.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("renpy.display.render.take_focuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":447
 * Modal = renpy.object.Sentinel("Modal")
 * 
 * def focus_at_point(x, y):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a focus object corresponding to the uppermost displayable
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_25focus_at_point(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_24focus_at_point[] = "\n    Returns a focus object corresponding to the uppermost displayable\n    at point, or None if nothing focusable is at point.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_25focus_at_point = {"focus_at_point", (PyCFunction)__pyx_pw_5renpy_7display_6render_25focus_at_point, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_24focus_at_point};
static PyObject *__pyx_pw_5renpy_7display_6render_25focus_at_point(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("focus_at_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("focus_at_point", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "focus_at_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("focus_at_point", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.focus_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_24focus_at_point(__pyx_self, __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_24focus_at_point(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_v_cf = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_screen = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("focus_at_point", 0);

  /* "renpy/display/render.pyx":453
 *     """
 * 
 *     if screen_render is None:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":454
 * 
 *     if screen_render is None:
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     cf = screen_render.focus_at_point(x, y, None)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":456
 *         return None
 * 
 *     cf = screen_render.focus_at_point(x, y, None)             # <<<<<<<<<<<<<<
 *     if cf is None or cf is Modal:
 *         return None
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_focus_at_point); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_cf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":457
 * 
 *     cf = screen_render.focus_at_point(x, y, None)
 *     if cf is None or cf is Modal:             # <<<<<<<<<<<<<<
 *         return None
 *     else:
 */
  __pyx_t_2 = (__pyx_v_cf == Py_None);
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_3 = __pyx_t_8;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Modal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = (__pyx_v_cf == __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_8 != 0);
  __pyx_t_3 = __pyx_t_2;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":458
 *     cf = screen_render.focus_at_point(x, y, None)
 *     if cf is None or cf is Modal:
 *         return None             # <<<<<<<<<<<<<<
 *     else:
 *         d, arg, screen = cf
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":460
 *         return None
 *     else:
 *         d, arg, screen = cf             # <<<<<<<<<<<<<<
 *         return renpy.display.focus.Focus(d, arg, None, None, None, None, screen)
 * 
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_cf))) || (PyList_CheckExact(__pyx_v_cf))) {
      PyObject* sequence = __pyx_v_cf;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_4 = PyObject_GetIter(__pyx_v_cf); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __pyx_t_7 = __pyx_t_9(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_4), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __pyx_v_d = __pyx_t_1;
    __pyx_t_1 = 0;
    __pyx_v_arg = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_screen = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "renpy/display/render.pyx":461
 *     else:
 *         d, arg, screen = cf
 *         return renpy.display.focus.Focus(d, arg, None, None, None, None, screen)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_focus); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Focus); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(7+__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    __Pyx_INCREF(__pyx_v_arg);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_arg);
    __Pyx_GIVEREF(__pyx_v_arg);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_6, Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 4+__pyx_t_6, Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_4, 5+__pyx_t_6, Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_INCREF(__pyx_v_screen);
    PyTuple_SET_ITEM(__pyx_t_4, 6+__pyx_t_6, __pyx_v_screen);
    __Pyx_GIVEREF(__pyx_v_screen);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":447
 * Modal = renpy.object.Sentinel("Modal")
 * 
 * def focus_at_point(x, y):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a focus object corresponding to the uppermost displayable
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.focus_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cf);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_screen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":464
 * 
 * 
 * def mutated_surface(surf):             # <<<<<<<<<<<<<<
 *     """
 *     Called to indicate that the given surface has changed.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_27mutated_surface(PyObject *__pyx_self, PyObject *__pyx_v_surf); /*proto*/
static char __pyx_doc_5renpy_7display_6render_26mutated_surface[] = "\n    Called to indicate that the given surface has changed.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_27mutated_surface = {"mutated_surface", (PyCFunction)__pyx_pw_5renpy_7display_6render_27mutated_surface, METH_O, __pyx_doc_5renpy_7display_6render_26mutated_surface};
static PyObject *__pyx_pw_5renpy_7display_6render_27mutated_surface(PyObject *__pyx_self, PyObject *__pyx_v_surf) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutated_surface (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_26mutated_surface(__pyx_self, ((PyObject *)__pyx_v_surf));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_26mutated_surface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_surf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutated_surface", 0);

  /* "renpy/display/render.pyx":469
 *     """
 * 
 *     renpy.display.draw.mutated_surface(surf)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_mutated_surface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_surf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_surf);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_surf);
    __Pyx_GIVEREF(__pyx_v_surf);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":464
 * 
 * 
 * def mutated_surface(surf):             # <<<<<<<<<<<<<<
 *     """
 *     Called to indicate that the given surface has changed.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("renpy.display.render.mutated_surface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":472
 * 
 * 
 * def render_screen(root, width, height):             # <<<<<<<<<<<<<<
 *     """
 *     Renders `root` (a displayable) as the root of a screen with the given
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_29render_screen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_28render_screen[] = "\n    Renders `root` (a displayable) as the root of a screen with the given\n    `width` and `height`.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_29render_screen = {"render_screen", (PyCFunction)__pyx_pw_5renpy_7display_6render_29render_screen, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_28render_screen};
static PyObject *__pyx_pw_5renpy_7display_6render_29render_screen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_root = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_screen (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_root,&__pyx_n_s_width,&__pyx_n_s_height,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_root)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_screen", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("render_screen", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render_screen") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_root = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_screen", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.render_screen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_28render_screen(__pyx_self, __pyx_v_root, __pyx_v_width, __pyx_v_height);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_28render_screen(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_root, PyObject *__pyx_v_width, PyObject *__pyx_v_height) {
  PyObject *__pyx_v_interact_time = NULL;
  PyObject *__pyx_v_st = NULL;
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_screen", 0);

  /* "renpy/display/render.pyx":482
 *     global frame_time
 * 
 *     interact_time = renpy.display.interface.interact_time             # <<<<<<<<<<<<<<
 *     frame_time = renpy.display.interface.frame_time
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_interface); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interact_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_interact_time = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":483
 * 
 *     interact_time = renpy.display.interface.interact_time
 *     frame_time = renpy.display.interface.frame_time             # <<<<<<<<<<<<<<
 * 
 *     if interact_time is None:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_interface); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_frame_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_5renpy_7display_6render_frame_time = __pyx_t_3;

  /* "renpy/display/render.pyx":485
 *     frame_time = renpy.display.interface.frame_time
 * 
 *     if interact_time is None:             # <<<<<<<<<<<<<<
 *         st = 0
 *     else:
 */
  __pyx_t_4 = (__pyx_v_interact_time == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "renpy/display/render.pyx":486
 * 
 *     if interact_time is None:
 *         st = 0             # <<<<<<<<<<<<<<
 *     else:
 *         st = frame_time  - interact_time
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_v_st = __pyx_int_0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":488
 *         st = 0
 *     else:
 *         st = frame_time  - interact_time             # <<<<<<<<<<<<<<
 * 
 *     rv = render(root, width, height, st, st)
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_5renpy_7display_6render_frame_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_interact_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_st = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":490
 *         st = frame_time  - interact_time
 * 
 *     rv = render(root, width, height, st, st)             # <<<<<<<<<<<<<<
 *     screen_render = rv
 * 
 */
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_st); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_f_5renpy_7display_6render_render(__pyx_v_root, __pyx_v_width, __pyx_v_height, __pyx_t_3, __pyx_t_6, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_rv = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":491
 * 
 *     rv = render(root, width, height, st, st)
 *     screen_render = rv             # <<<<<<<<<<<<<<
 * 
 *     invalidated = False
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_screen_render, __pyx_v_rv) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":493
 *     screen_render = rv
 * 
 *     invalidated = False             # <<<<<<<<<<<<<<
 * 
 *     rv.is_opaque()
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_invalidated, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":495
 *     invalidated = False
 * 
 *     rv.is_opaque()             # <<<<<<<<<<<<<<
 * 
 *     return rv
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_7) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":497
 *     rv.is_opaque()
 * 
 *     return rv             # <<<<<<<<<<<<<<
 * 
 * def mark_sweep():
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":472
 * 
 * 
 * def render_screen(root, width, height):             # <<<<<<<<<<<<<<
 *     """
 *     Renders `root` (a displayable) as the root of a screen with the given
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.render_screen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_interact_time);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":499
 *     return rv
 * 
 * def mark_sweep():             # <<<<<<<<<<<<<<
 *     """
 *     This performs mark-and-sweep garbage collection on the live_renders
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_31mark_sweep(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_30mark_sweep[] = "\n    This performs mark-and-sweep garbage collection on the live_renders\n    list.\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_31mark_sweep = {"mark_sweep", (PyCFunction)__pyx_pw_5renpy_7display_6render_31mark_sweep, METH_NOARGS, __pyx_doc_5renpy_7display_6render_30mark_sweep};
static PyObject *__pyx_pw_5renpy_7display_6render_31mark_sweep(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mark_sweep (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_30mark_sweep(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_30mark_sweep(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_v_worklist = 0;
  int __pyx_v_i;
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_r = 0;
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_j = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mark_sweep", 0);

  /* "renpy/display/render.pyx":511
 *     cdef Render r, j
 * 
 *     worklist = [ ]             # <<<<<<<<<<<<<<
 * 
 *     if screen_render is not None:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_worklist = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":513
 *     worklist = [ ]
 * 
 *     if screen_render is not None:             # <<<<<<<<<<<<<<
 *         worklist.append(screen_render)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":514
 * 
 *     if screen_render is not None:
 *         worklist.append(screen_render)             # <<<<<<<<<<<<<<
 * 
 *     i = 0
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_worklist, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":516
 *         worklist.append(screen_render)
 * 
 *     i = 0             # <<<<<<<<<<<<<<
 * 
 *     while i < len(worklist):
 */
  __pyx_v_i = 0;

  /* "renpy/display/render.pyx":518
 *     i = 0
 * 
 *     while i < len(worklist):             # <<<<<<<<<<<<<<
 *         r = worklist[i]
 * 
 */
  while (1) {
    __pyx_t_5 = PyList_GET_SIZE(__pyx_v_worklist); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = ((__pyx_v_i < __pyx_t_5) != 0);
    if (!__pyx_t_3) break;

    /* "renpy/display/render.pyx":519
 * 
 *     while i < len(worklist):
 *         r = worklist[i]             # <<<<<<<<<<<<<<
 * 
 *         for j in r.depends_on_list:
 */
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_worklist, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_r, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":521
 *         r = worklist[i]
 * 
 *         for j in r.depends_on_list:             # <<<<<<<<<<<<<<
 *             if not j.mark:
 *                 j.mark = True
 */
    if (unlikely(__pyx_v_r->depends_on_list == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_1 = __pyx_v_r->depends_on_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_j, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "renpy/display/render.pyx":522
 * 
 *         for j in r.depends_on_list:
 *             if not j.mark:             # <<<<<<<<<<<<<<
 *                 j.mark = True
 *                 worklist.append(j)
 */
      __pyx_t_3 = ((!(__pyx_v_j->mark != 0)) != 0);
      if (__pyx_t_3) {

        /* "renpy/display/render.pyx":523
 *         for j in r.depends_on_list:
 *             if not j.mark:
 *                 j.mark = True             # <<<<<<<<<<<<<<
 *                 worklist.append(j)
 * 
 */
        __pyx_v_j->mark = 1;

        /* "renpy/display/render.pyx":524
 *             if not j.mark:
 *                 j.mark = True
 *                 worklist.append(j)             # <<<<<<<<<<<<<<
 * 
 *         i += 1
 */
        __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_worklist, ((PyObject *)__pyx_v_j)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "renpy/display/render.pyx":521
 *         r = worklist[i]
 * 
 *         for j in r.depends_on_list:             # <<<<<<<<<<<<<<
 *             if not j.mark:
 *                 j.mark = True
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":526
 *                 worklist.append(j)
 * 
 *         i += 1             # <<<<<<<<<<<<<<
 * 
 *     if screen_render is not None:
 */
    __pyx_v_i = (__pyx_v_i + 1);
  }

  /* "renpy/display/render.pyx":528
 *         i += 1
 * 
 *     if screen_render is not None:             # <<<<<<<<<<<<<<
 *         screen_render.mark = True
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":529
 * 
 *     if screen_render is not None:
 *         screen_render.mark = True             # <<<<<<<<<<<<<<
 * 
 *     for r in live_renders:
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_screen_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_mark, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "renpy/display/render.pyx":531
 *         screen_render.mark = True
 * 
 *     for r in live_renders:             # <<<<<<<<<<<<<<
 *         if not r.mark:
 *             r.kill_cache()
 */
  if (unlikely(__pyx_v_5renpy_7display_6render_live_renders == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_5renpy_7display_6render_live_renders; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5renpy_7display_6render_Render))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_XDECREF_SET(__pyx_v_r, ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "renpy/display/render.pyx":532
 * 
 *     for r in live_renders:
 *         if not r.mark:             # <<<<<<<<<<<<<<
 *             r.kill_cache()
 *         else:
 */
    __pyx_t_2 = ((!(__pyx_v_r->mark != 0)) != 0);
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":533
 *     for r in live_renders:
 *         if not r.mark:
 *             r.kill_cache()             # <<<<<<<<<<<<<<
 *         else:
 *             r.mark = False
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_r), __pyx_n_s_kill_cache); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_8) {
        __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      } else {
        __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L12;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":535
 *             r.kill_cache()
 *         else:
 *             r.mark = False             # <<<<<<<<<<<<<<
 * 
 *     live_renders = worklist
 */
      __pyx_v_r->mark = 0;
    }
    __pyx_L12:;

    /* "renpy/display/render.pyx":531
 *         screen_render.mark = True
 * 
 *     for r in live_renders:             # <<<<<<<<<<<<<<
 *         if not r.mark:
 *             r.kill_cache()
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":537
 *             r.mark = False
 * 
 *     live_renders = worklist             # <<<<<<<<<<<<<<
 * 
 * def compute_subline(sx0, sw, cx0, cw):
 */
  __Pyx_INCREF(__pyx_v_worklist);
  __Pyx_XGOTREF(__pyx_v_5renpy_7display_6render_live_renders);
  __Pyx_DECREF_SET(__pyx_v_5renpy_7display_6render_live_renders, __pyx_v_worklist);
  __Pyx_GIVEREF(__pyx_v_worklist);

  /* "renpy/display/render.pyx":499
 *     return rv
 * 
 * def mark_sweep():             # <<<<<<<<<<<<<<
 *     """
 *     This performs mark-and-sweep garbage collection on the live_renders
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("renpy.display.render.mark_sweep", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_worklist);
  __Pyx_XDECREF((PyObject *)__pyx_v_r);
  __Pyx_XDECREF((PyObject *)__pyx_v_j);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":539
 *     live_renders = worklist
 * 
 * def compute_subline(sx0, sw, cx0, cw):             # <<<<<<<<<<<<<<
 *     """
 *     Given a source line (start sx0, width sw) and a crop line (cx0, cw),
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_33compute_subline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_32compute_subline[] = "\n    Given a source line (start sx0, width sw) and a crop line (cx0, cw),\n    return three things:\n\n    * The offset of the portion of the source line that overlaps with\n      the crop line, relative to the crop line.\n    * The offset of the portion of the source line that overlaps with the\n      the crop line, relative to the source line.\n    * The length of the overlap in pixels. (can be <= 0)\n    ";
static PyMethodDef __pyx_mdef_5renpy_7display_6render_33compute_subline = {"compute_subline", (PyCFunction)__pyx_pw_5renpy_7display_6render_33compute_subline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_32compute_subline};
static PyObject *__pyx_pw_5renpy_7display_6render_33compute_subline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sx0 = 0;
  PyObject *__pyx_v_sw = 0;
  PyObject *__pyx_v_cx0 = 0;
  PyObject *__pyx_v_cw = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compute_subline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sx0,&__pyx_n_s_sw,&__pyx_n_s_cx0,&__pyx_n_s_cw,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sx0)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_subline", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cx0)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_subline", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cw)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("compute_subline", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_subline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_sx0 = values[0];
    __pyx_v_sw = values[1];
    __pyx_v_cx0 = values[2];
    __pyx_v_cw = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compute_subline", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.compute_subline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_32compute_subline(__pyx_self, __pyx_v_sx0, __pyx_v_sw, __pyx_v_cx0, __pyx_v_cw);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_32compute_subline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sx0, PyObject *__pyx_v_sw, PyObject *__pyx_v_cx0, PyObject *__pyx_v_cw) {
  PyObject *__pyx_v_sx1 = NULL;
  PyObject *__pyx_v_cx1 = NULL;
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_crop = NULL;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compute_subline", 0);

  /* "renpy/display/render.pyx":551
 *     """
 * 
 *     sx1 = sx0 + sw             # <<<<<<<<<<<<<<
 *     cx1 = cx0 + cw
 * 
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_sx0, __pyx_v_sw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sx1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":552
 * 
 *     sx1 = sx0 + sw
 *     cx1 = cx0 + cw             # <<<<<<<<<<<<<<
 * 
 *     if sx0 > cx0:
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_cx0, __pyx_v_cw); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cx1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":554
 *     cx1 = cx0 + cw
 * 
 *     if sx0 > cx0:             # <<<<<<<<<<<<<<
 *         start = sx0
 *     else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_sx0, __pyx_v_cx0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":555
 * 
 *     if sx0 > cx0:
 *         start = sx0             # <<<<<<<<<<<<<<
 *     else:
 *         start = cx0
 */
    __Pyx_INCREF(__pyx_v_sx0);
    __pyx_v_start = __pyx_v_sx0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":557
 *         start = sx0
 *     else:
 *         start = cx0             # <<<<<<<<<<<<<<
 * 
 *     offset = start - cx0
 */
    __Pyx_INCREF(__pyx_v_cx0);
    __pyx_v_start = __pyx_v_cx0;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":559
 *         start = cx0
 * 
 *     offset = start - cx0             # <<<<<<<<<<<<<<
 *     crop = start - sx0
 * 
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_start, __pyx_v_cx0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_offset = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":560
 * 
 *     offset = start - cx0
 *     crop = start - sx0             # <<<<<<<<<<<<<<
 * 
 *     if sx1 < cx1:
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_start, __pyx_v_sx0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_crop = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":562
 *     crop = start - sx0
 * 
 *     if sx1 < cx1:             # <<<<<<<<<<<<<<
 *         width = sx1 - start
 *     else:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_sx1, __pyx_v_cx1, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":563
 * 
 *     if sx1 < cx1:
 *         width = sx1 - start             # <<<<<<<<<<<<<<
 *     else:
 *         width = cx1 - start
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_sx1, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_width = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":565
 *         width = sx1 - start
 *     else:
 *         width = cx1 - start             # <<<<<<<<<<<<<<
 * 
 *     return offset, crop, width
 */
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_cx1, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_width = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":567
 *         width = cx1 - start
 * 
 *     return offset, crop, width             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_offset);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_offset);
  __Pyx_GIVEREF(__pyx_v_offset);
  __Pyx_INCREF(__pyx_v_crop);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_crop);
  __Pyx_GIVEREF(__pyx_v_crop);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":539
 *     live_renders = worklist
 * 
 * def compute_subline(sx0, sw, cx0, cw):             # <<<<<<<<<<<<<<
 *     """
 *     Given a source line (start sx0, width sw) and a crop line (cx0, cw),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.compute_subline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sx1);
  __Pyx_XDECREF(__pyx_v_cx1);
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_crop);
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":581
 * cdef class Render:
 * 
 *     def __init__(Render self, float width, float height, draw_func=None, layer_name=None, bint opaque=False): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         Creates a new render corresponding to the given widget with
 */

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render___init__[] = "\n        Creates a new render corresponding to the given widget with\n        the specified width and height.\n\n        If `layer_name` is given, then this render corresponds to a\n        layer.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_5renpy_7display_6render_6Render___init__;
#endif
static int __pyx_pw_5renpy_7display_6render_6Render_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  float __pyx_v_width;
  float __pyx_v_height;
  PyObject *__pyx_v_draw_func = 0;
  PyObject *__pyx_v_layer_name = 0;
  int __pyx_v_opaque;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_draw_func,&__pyx_n_s_layer_name,&__pyx_n_s_opaque,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_None);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_draw_func);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_layer_name);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_opaque);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_width = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_width == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_height = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_height == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_draw_func = values[2];
    __pyx_v_layer_name = values[3];
    if (values[4]) {
      __pyx_v_opaque = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_opaque == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_opaque = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render___init__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_width, __pyx_v_height, __pyx_v_draw_func, __pyx_v_layer_name, __pyx_v_opaque);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render___init__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, float __pyx_v_width, float __pyx_v_height, PyObject *__pyx_v_draw_func, PyObject *__pyx_v_layer_name, int __pyx_v_opaque) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "renpy/display/render.pyx":592
 *         # The mark bit, used for mark/sweep-style garbage collection of
 *         # renders.
 *         self.mark = False             # <<<<<<<<<<<<<<
 * 
 *         # Is has this render been removed from the cache?
 */
  __pyx_v_self->mark = 0;

  /* "renpy/display/render.pyx":595
 * 
 *         # Is has this render been removed from the cache?
 *         self.cache_killed = False             # <<<<<<<<<<<<<<
 * 
 *         self.width = width
 */
  __pyx_v_self->cache_killed = 0;

  /* "renpy/display/render.pyx":597
 *         self.cache_killed = False
 * 
 *         self.width = width             # <<<<<<<<<<<<<<
 *         self.height = height
 * 
 */
  __pyx_v_self->width = __pyx_v_width;

  /* "renpy/display/render.pyx":598
 * 
 *         self.width = width
 *         self.height = height             # <<<<<<<<<<<<<<
 * 
 *         self.layer_name = layer_name
 */
  __pyx_v_self->height = __pyx_v_height;

  /* "renpy/display/render.pyx":600
 *         self.height = height
 * 
 *         self.layer_name = layer_name             # <<<<<<<<<<<<<<
 * 
 *         # A list of (surface/render, xoffset, yoffset, focus, main) tuples, ordered from
 */
  __Pyx_INCREF(__pyx_v_layer_name);
  __Pyx_GIVEREF(__pyx_v_layer_name);
  __Pyx_GOTREF(__pyx_v_self->layer_name);
  __Pyx_DECREF(__pyx_v_self->layer_name);
  __pyx_v_self->layer_name = __pyx_v_layer_name;

  /* "renpy/display/render.pyx":604
 *         # A list of (surface/render, xoffset, yoffset, focus, main) tuples, ordered from
 *         # back to front.
 *         self.children = [ ]             # <<<<<<<<<<<<<<
 * 
 *         # Forward is used to transform from screen coordinates to child
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->children);
  __Pyx_DECREF(__pyx_v_self->children);
  __pyx_v_self->children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":614
 *         # x and y offsets found in self.children. Those offsets should
 *         # be of the (0, 0) point in the child coordinate space.
 *         self.forward = None             # <<<<<<<<<<<<<<
 *         self.reverse = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->forward);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
  __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None);

  /* "renpy/display/render.pyx":615
 *         # be of the (0, 0) point in the child coordinate space.
 *         self.forward = None
 *         self.reverse = None             # <<<<<<<<<<<<<<
 * 
 *         # This is used to adjust the alpha of children of this render.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->reverse);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->reverse));
  __pyx_v_self->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None);

  /* "renpy/display/render.pyx":618
 * 
 *         # This is used to adjust the alpha of children of this render.
 *         self.alpha = 1             # <<<<<<<<<<<<<<
 * 
 *         # The over blending factor. When this is 1.0, blends only use the
 */
  __pyx_v_self->alpha = 1.0;

  /* "renpy/display/render.pyx":622
 *         # The over blending factor. When this is 1.0, blends only use the
 *         # over operation. When set to 0.0, we get additive blending.
 *         self.over = 1.0             # <<<<<<<<<<<<<<
 * 
 *         # If true, children of this render use nearest-neighbor texture
 */
  __pyx_v_self->over = 1.0;

  /* "renpy/display/render.pyx":626
 *         # If true, children of this render use nearest-neighbor texture
 *         # lookup. If false, bilinear, if None, from the parent.
 *         self.nearest = None             # <<<<<<<<<<<<<<
 * 
 *         # A list of focus regions in this displayable.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->nearest);
  __Pyx_DECREF(__pyx_v_self->nearest);
  __pyx_v_self->nearest = Py_None;

  /* "renpy/display/render.pyx":629
 * 
 *         # A list of focus regions in this displayable.
 *         self.focuses = None             # <<<<<<<<<<<<<<
 * 
 *         # Other renders that we should pass focus onto.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->focuses);
  __Pyx_DECREF(__pyx_v_self->focuses);
  __pyx_v_self->focuses = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":632
 * 
 *         # Other renders that we should pass focus onto.
 *         self.pass_focuses = None             # <<<<<<<<<<<<<<
 * 
 *         # The ScreenDisplayable this is a render of.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->pass_focuses);
  __Pyx_DECREF(__pyx_v_self->pass_focuses);
  __pyx_v_self->pass_focuses = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":635
 * 
 *         # The ScreenDisplayable this is a render of.
 *         self.focus_screen = None             # <<<<<<<<<<<<<<
 * 
 *         # The displayable(s) that this is a render of. (Set by render)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->focus_screen);
  __Pyx_DECREF(__pyx_v_self->focus_screen);
  __pyx_v_self->focus_screen = Py_None;

  /* "renpy/display/render.pyx":638
 * 
 *         # The displayable(s) that this is a render of. (Set by render)
 *         self.render_of = [ ]             # <<<<<<<<<<<<<<
 * 
 *         # If set, this is a function that's called to draw this render
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->render_of);
  __Pyx_DECREF(__pyx_v_self->render_of);
  __pyx_v_self->render_of = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":642
 *         # If set, this is a function that's called to draw this render
 *         # instead of the default.
 *         self.draw_func = draw_func             # <<<<<<<<<<<<<<
 * 
 *         # Is this displayable opaque? (May be set on init, or later on
 */
  __Pyx_INCREF(__pyx_v_draw_func);
  __Pyx_GIVEREF(__pyx_v_draw_func);
  __Pyx_GOTREF(__pyx_v_self->draw_func);
  __Pyx_DECREF(__pyx_v_self->draw_func);
  __pyx_v_self->draw_func = __pyx_v_draw_func;

  /* "renpy/display/render.pyx":647
 *         # if we have opaque children.) This may be True, False, or None
 *         # to indicate we don't know yet.
 *         self.opaque = opaque             # <<<<<<<<<<<<<<
 * 
 *         # A list of our visible children. (That is, children above and
 */
  __pyx_v_self->opaque = __pyx_v_opaque;

  /* "renpy/display/render.pyx":652
 *         # including our uppermost opaque child.) If nothing is opaque,
 *         # includes all children.
 *         self.visible_children = self.children             # <<<<<<<<<<<<<<
 * 
 *         # Should children be clipped to a rectangle?
 */
  __pyx_t_1 = __pyx_v_self->children;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->visible_children);
  __Pyx_DECREF(__pyx_v_self->visible_children);
  __pyx_v_self->visible_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":655
 * 
 *         # Should children be clipped to a rectangle?
 *         self.xclipping = False             # <<<<<<<<<<<<<<
 *         self.yclipping = False
 * 
 */
  __pyx_v_self->xclipping = 0;

  /* "renpy/display/render.pyx":656
 *         # Should children be clipped to a rectangle?
 *         self.xclipping = False
 *         self.yclipping = False             # <<<<<<<<<<<<<<
 * 
 *         # Are we modal?
 */
  __pyx_v_self->yclipping = 0;

  /* "renpy/display/render.pyx":659
 * 
 *         # Are we modal?
 *         self.modal = False             # <<<<<<<<<<<<<<
 * 
 *         # Are we a text input?
 */
  __pyx_v_self->modal = 0;

  /* "renpy/display/render.pyx":662
 * 
 *         # Are we a text input?
 *         self.text_input = False             # <<<<<<<<<<<<<<
 * 
 *         # gl, sw
 */
  __pyx_v_self->text_input = 0;

  /* "renpy/display/render.pyx":668
 *         # The set of renders that either have us as children, or depend on
 *         # us.
 *         self.parents = set()             # <<<<<<<<<<<<<<
 * 
 *         # The renders we depend on, including our children.
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->parents);
  __Pyx_DECREF(__pyx_v_self->parents);
  __pyx_v_self->parents = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":671
 * 
 *         # The renders we depend on, including our children.
 *         self.depends_on_list = [ ]             # <<<<<<<<<<<<<<
 * 
 *         # The operation we're performing. (BLIT, DISSOLVE, OR IMAGE_DISSOLVE)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->depends_on_list);
  __Pyx_DECREF(__pyx_v_self->depends_on_list);
  __pyx_v_self->depends_on_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":674
 * 
 *         # The operation we're performing. (BLIT, DISSOLVE, OR IMAGE_DISSOLVE)
 *         self.operation = BLIT             # <<<<<<<<<<<<<<
 * 
 *         # The fraction of the operation that is complete.
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_BLIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->operation = __pyx_t_2;

  /* "renpy/display/render.pyx":677
 * 
 *         # The fraction of the operation that is complete.
 *         self.operation_complete = 0.0             # <<<<<<<<<<<<<<
 * 
 *         # Should the dissolve operations preserve alpha?
 */
  __pyx_v_self->operation_complete = 0.0;

  /* "renpy/display/render.pyx":680
 * 
 *         # Should the dissolve operations preserve alpha?
 *         self.operation_alpha = False             # <<<<<<<<<<<<<<
 * 
 *         # The parameter to the operation.
 */
  __pyx_v_self->operation_alpha = 0;

  /* "renpy/display/render.pyx":683
 * 
 *         # The parameter to the operation.
 *         self.operation_parameter = 0             # <<<<<<<<<<<<<<
 * 
 *         # Caches of the texture created by rendering this surface.
 */
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_GOTREF(__pyx_v_self->operation_parameter);
  __Pyx_DECREF(__pyx_v_self->operation_parameter);
  __pyx_v_self->operation_parameter = __pyx_int_0;

  /* "renpy/display/render.pyx":686
 * 
 *         # Caches of the texture created by rendering this surface.
 *         self.surface = None             # <<<<<<<<<<<<<<
 *         self.alpha_surface = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->surface);
  __Pyx_DECREF(__pyx_v_self->surface);
  __pyx_v_self->surface = Py_None;

  /* "renpy/display/render.pyx":687
 *         # Caches of the texture created by rendering this surface.
 *         self.surface = None
 *         self.alpha_surface = None             # <<<<<<<<<<<<<<
 * 
 *         # Cache of the texture created by rendering this surface at half size.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->alpha_surface);
  __Pyx_DECREF(__pyx_v_self->alpha_surface);
  __pyx_v_self->alpha_surface = Py_None;

  /* "renpy/display/render.pyx":691
 *         # Cache of the texture created by rendering this surface at half size.
 *         # (This is set in gldraw.)
 *         self.half_cache = None             # <<<<<<<<<<<<<<
 * 
 *         # gl2
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->half_cache);
  __Pyx_DECREF(__pyx_v_self->half_cache);
  __pyx_v_self->half_cache = Py_None;

  /* "renpy/display/render.pyx":698
 *         # and used to form a model. If this is True, the Mesh is taken from the first
 *         # child's Texture, otherwise this must be a Mesh.
 *         self.mesh = None             # <<<<<<<<<<<<<<
 * 
 *         # A tuple of shaders that will be used when rendering, or None.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = Py_None;

  /* "renpy/display/render.pyx":701
 * 
 *         # A tuple of shaders that will be used when rendering, or None.
 *         self.shaders = None             # <<<<<<<<<<<<<<
 * 
 *         # A dictionary containing uniforms that will be used when rendering, or
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->shaders);
  __Pyx_DECREF(__pyx_v_self->shaders);
  __pyx_v_self->shaders = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":705
 *         # A dictionary containing uniforms that will be used when rendering, or
 *         # None.
 *         self.uniforms = None             # <<<<<<<<<<<<<<
 * 
 *         # Properties that are used for rendering.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->uniforms);
  __Pyx_DECREF(__pyx_v_self->uniforms);
  __pyx_v_self->uniforms = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":708
 * 
 *         # Properties that are used for rendering.
 *         self.properties = None             # <<<<<<<<<<<<<<
 * 
 *         # Used to cache the result of rendering this Render to a texture.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->properties);
  __Pyx_DECREF(__pyx_v_self->properties);
  __pyx_v_self->properties = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":711
 * 
 *         # Used to cache the result of rendering this Render to a texture.
 *         self.cached_texture = None             # <<<<<<<<<<<<<<
 * 
 *         # Used to cache the model.
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cached_texture);
  __Pyx_DECREF(__pyx_v_self->cached_texture);
  __pyx_v_self->cached_texture = Py_None;

  /* "renpy/display/render.pyx":714
 * 
 *         # Used to cache the model.
 *         self.cached_model = None             # <<<<<<<<<<<<<<
 * 
 *         # Have the textures been loaded?
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cached_model);
  __Pyx_DECREF(__pyx_v_self->cached_model);
  __pyx_v_self->cached_model = Py_None;

  /* "renpy/display/render.pyx":717
 * 
 *         # Have the textures been loaded?
 *         self.loaded = False             # <<<<<<<<<<<<<<
 * 
 *         live_renders.append(self)
 */
  __pyx_v_self->loaded = 0;

  /* "renpy/display/render.pyx":719
 *         self.loaded = False
 * 
 *         live_renders.append(self)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self): #@DuplicatedSignature
 */
  if (unlikely(__pyx_v_5renpy_7display_6render_live_renders == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_5renpy_7display_6render_live_renders, ((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":581
 * cdef class Render:
 * 
 *     def __init__(Render self, float width, float height, draw_func=None, layer_name=None, bint opaque=False): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         Creates a new render corresponding to the given widget with
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":721
 *         live_renders.append(self)
 * 
 *     def __repr__(self): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         return "<{}Render {:x} of {!r}>".format(
 *             ("dead " if self.cache_killed else ""),
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_2__repr__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_2__repr__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "renpy/display/render.pyx":722
 * 
 *     def __repr__(self): #@DuplicatedSignature
 *         return "<{}Render {:x} of {!r}>".format(             # <<<<<<<<<<<<<<
 *             ("dead " if self.cache_killed else ""),
 *             id(self),
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Render_x_of_r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "renpy/display/render.pyx":723
 *     def __repr__(self): #@DuplicatedSignature
 *         return "<{}Render {:x} of {!r}>".format(
 *             ("dead " if self.cache_killed else ""),             # <<<<<<<<<<<<<<
 *             id(self),
 *             self.render_of)
 */
  if ((__pyx_v_self->cache_killed != 0)) {
    __Pyx_INCREF(__pyx_kp_s_dead);
    __pyx_t_3 = __pyx_kp_s_dead;
  } else {
    __Pyx_INCREF(__pyx_kp_s__4);
    __pyx_t_3 = __pyx_kp_s__4;
  }

  /* "renpy/display/render.pyx":724
 *         return "<{}Render {:x} of {!r}>".format(
 *             ("dead " if self.cache_killed else ""),
 *             id(self),             # <<<<<<<<<<<<<<
 *             self.render_of)
 * 
 */
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":725
 *             ("dead " if self.cache_killed else ""),
 *             id(self),
 *             self.render_of)             # <<<<<<<<<<<<<<
 * 
 *     def __getstate__(self): #@DuplicatedSignature
 */
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->render_of);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_self->render_of);
  __Pyx_GIVEREF(__pyx_v_self->render_of);
  __pyx_t_3 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":721
 *         live_renders.append(self)
 * 
 *     def __repr__(self): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         return "<{}Render {:x} of {!r}>".format(
 *             ("dead " if self.cache_killed else ""),
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":727
 *             self.render_of)
 * 
 *     def __getstate__(self): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         if renpy.config.developer:
 *             raise Exception("Can't pickle a Render.")
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4__getstate__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4__getstate__(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "renpy/display/render.pyx":728
 * 
 *     def __getstate__(self): #@DuplicatedSignature
 *         if renpy.config.developer:             # <<<<<<<<<<<<<<
 *             raise Exception("Can't pickle a Render.")
 *         else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_developer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":729
 *     def __getstate__(self): #@DuplicatedSignature
 *         if renpy.config.developer:
 *             raise Exception("Can't pickle a Render.")             # <<<<<<<<<<<<<<
 *         else:
 *             return { }
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  /*else*/ {

    /* "renpy/display/render.pyx":731
 *             raise Exception("Can't pickle a Render.")
 *         else:
 *             return { }             # <<<<<<<<<<<<<<
 * 
 *     def __setstate__(self, state): #@DuplicatedSignature
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":727
 *             self.render_of)
 * 
 *     def __getstate__(self): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         if renpy.config.developer:
 *             raise Exception("Can't pickle a Render.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("renpy.display.render.Render.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":733
 *             return { }
 * 
 *     def __setstate__(self, state): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         return
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6__setstate__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6__setstate__(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "renpy/display/render.pyx":734
 * 
 *     def __setstate__(self, state): #@DuplicatedSignature
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "renpy/display/render.pyx":733
 *             return { }
 * 
 *     def __setstate__(self, state): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         return
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":736
 *         return
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5renpy_7display_6render_6Render_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_blit *__pyx_optional_args) {
  PyObject *__pyx_v_focus = ((PyObject *)Py_True);
  PyObject *__pyx_v_main = ((PyObject *)Py_True);
  PyObject *__pyx_v_index = ((PyObject *)Py_None);
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_focus = __pyx_optional_args->focus;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_main = __pyx_optional_args->main;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_index = __pyx_optional_args->index;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_blit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_9blit)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_INCREF(__pyx_v_pos);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_pos);
      __Pyx_GIVEREF(__pyx_v_pos);
      __Pyx_INCREF(__pyx_v_focus);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_focus);
      __Pyx_GIVEREF(__pyx_v_focus);
      __Pyx_INCREF(__pyx_v_main);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_main);
      __Pyx_GIVEREF(__pyx_v_main);
      __Pyx_INCREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":747
 *         """
 * 
 *         (xo, yo) = pos             # <<<<<<<<<<<<<<
 * 
 *         if source is self:
 */
  if (likely(__pyx_v_pos != Py_None)) {
    PyObject* sequence = __pyx_v_pos;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xo = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_yo = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":749
 *         (xo, yo) = pos
 * 
 *         if source is self:             # <<<<<<<<<<<<<<
 *             raise Exception("Blitting to self.")
 * 
 */
  __pyx_t_8 = (__pyx_v_source == ((PyObject *)__pyx_v_self));
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "renpy/display/render.pyx":750
 * 
 *         if source is self:
 *             raise Exception("Blitting to self.")             # <<<<<<<<<<<<<<
 * 
 *         xo = int(xo)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "renpy/display/render.pyx":752
 *             raise Exception("Blitting to self.")
 * 
 *         xo = int(xo)             # <<<<<<<<<<<<<<
 *         yo = int(yo)
 * 
 */
  __pyx_t_2 = PyNumber_Int(__pyx_v_xo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_xo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":753
 * 
 *         xo = int(xo)
 *         yo = int(yo)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  __pyx_t_2 = PyNumber_Int(__pyx_v_yo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_yo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":755
 *         yo = int(yo)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 */
  __pyx_t_9 = (__pyx_v_index == Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "renpy/display/render.pyx":756
 * 
 *         if index is None:
 *             self.children.append((source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->children, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":758
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(source, Render):
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "insert");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_10 = PyList_Insert(__pyx_v_self->children, __pyx_t_5, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":760
 *             self.children.insert(index, (source, xo, yo, focus, main))
 * 
 *         if isinstance(source, Render):             # <<<<<<<<<<<<<<
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)
 */
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_source, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "renpy/display/render.pyx":761
 * 
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)             # <<<<<<<<<<<<<<
 *             source.parents.add(self)
 * 
 */
    if (unlikely(__pyx_v_self->depends_on_list == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->depends_on_list, __pyx_v_source); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":762
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "renpy/display/render.pyx":764
 *             source.parents.add(self)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":736
 *         return
 * 
 *     cpdef int blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("renpy.display.render.Render.blit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_8blit[] = "\n        Blits `source` (a Render or Surface) to this Render, offset by\n        xo and yo.\n\n        If `focus` is true, then focuses are added from the child to the\n        parent.\n\n        This will only blit on integer pixel boundaries.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_focus = 0;
  PyObject *__pyx_v_main = 0;
  PyObject *__pyx_v_index = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("blit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_pos,&__pyx_n_s_focus,&__pyx_n_s_main,&__pyx_n_s_index,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focus);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_main);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "blit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_pos = ((PyObject*)values[1]);
    __pyx_v_focus = values[2];
    __pyx_v_main = values[3];
    __pyx_v_index = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("blit", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), (&PyTuple_Type), 1, "pos", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8blit(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_source, __pyx_v_pos, __pyx_v_focus, __pyx_v_main, __pyx_v_index);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_5renpy_7display_6render_6Render_blit __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("blit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.focus = __pyx_v_focus;
  __pyx_t_2.main = __pyx_v_main;
  __pyx_t_2.index = __pyx_v_index;
  __pyx_t_1 = __pyx_vtabptr_5renpy_7display_6render_Render->blit(__pyx_v_self, __pyx_v_source, __pyx_v_pos, 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.Render.blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":766
 *         return 0
 * 
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

static PyObject *__pyx_pw_5renpy_7display_6render_6Render_11subpixel_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5renpy_7display_6render_6Render_subpixel_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit *__pyx_optional_args) {
  PyObject *__pyx_v_focus = ((PyObject *)Py_True);
  PyObject *__pyx_v_main = ((PyObject *)Py_True);
  PyObject *__pyx_v_index = ((PyObject *)Py_None);
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  double __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("subpixel_blit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_focus = __pyx_optional_args->focus;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_main = __pyx_optional_args->main;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_index = __pyx_optional_args->index;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_subpixel_blit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_11subpixel_blit)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_INCREF(__pyx_v_pos);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_pos);
      __Pyx_GIVEREF(__pyx_v_pos);
      __Pyx_INCREF(__pyx_v_focus);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_focus);
      __Pyx_GIVEREF(__pyx_v_focus);
      __Pyx_INCREF(__pyx_v_main);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_main);
      __Pyx_GIVEREF(__pyx_v_main);
      __Pyx_INCREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":777
 *         """
 * 
 *         (xo, yo) = pos             # <<<<<<<<<<<<<<
 * 
 *         xo = float(xo)
 */
  if (likely(__pyx_v_pos != Py_None)) {
    PyObject* sequence = __pyx_v_pos;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xo = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_yo = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":779
 *         (xo, yo) = pos
 * 
 *         xo = float(xo)             # <<<<<<<<<<<<<<
 *         yo = float(yo)
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_xo); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_xo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":780
 * 
 *         xo = float(xo)
 *         yo = float(yo)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  __pyx_t_8 = __Pyx_PyObject_AsDouble(__pyx_v_yo); if (unlikely(__pyx_t_8 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_yo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":782
 *         yo = float(yo)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 */
  __pyx_t_9 = (__pyx_v_index == Py_None);
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {

    /* "renpy/display/render.pyx":783
 * 
 *         if index is None:
 *             self.children.append((source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_self->children, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":785
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(source, Render):
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "insert");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_11 = PyList_Insert(__pyx_v_self->children, __pyx_t_5, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":787
 *             self.children.insert(index, (source, xo, yo, focus, main))
 * 
 *         if isinstance(source, Render):             # <<<<<<<<<<<<<<
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)
 */
  __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_source, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
  __pyx_t_9 = (__pyx_t_10 != 0);
  if (__pyx_t_9) {

    /* "renpy/display/render.pyx":788
 * 
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)             # <<<<<<<<<<<<<<
 *             source.parents.add(self)
 * 
 */
    if (unlikely(__pyx_v_self->depends_on_list == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_self->depends_on_list, __pyx_v_source); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":789
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_parents); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":791
 *             source.parents.add(self)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":766
 *         return 0
 * 
 *     cpdef int subpixel_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("renpy.display.render.Render.subpixel_blit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_11subpixel_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_10subpixel_blit[] = "\n        Blits `source` (a Render or Surface) to this Render, offset by\n        xo and yo.\n\n        If `focus` is true, then focuses are added from the child to the\n        parent.\n\n        This blits at fractional pixel boundaries.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_11subpixel_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_focus = 0;
  PyObject *__pyx_v_main = 0;
  PyObject *__pyx_v_index = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("subpixel_blit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_pos,&__pyx_n_s_focus,&__pyx_n_s_main,&__pyx_n_s_index,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("subpixel_blit", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focus);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_main);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subpixel_blit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_pos = ((PyObject*)values[1]);
    __pyx_v_focus = values[2];
    __pyx_v_main = values[3];
    __pyx_v_index = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("subpixel_blit", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.subpixel_blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), (&PyTuple_Type), 1, "pos", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10subpixel_blit(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_source, __pyx_v_pos, __pyx_v_focus, __pyx_v_main, __pyx_v_index);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10subpixel_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("subpixel_blit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.focus = __pyx_v_focus;
  __pyx_t_2.main = __pyx_v_main;
  __pyx_t_2.index = __pyx_v_index;
  __pyx_t_1 = __pyx_vtabptr_5renpy_7display_6render_Render->subpixel_blit(__pyx_v_self, __pyx_v_source, __pyx_v_pos, 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.Render.subpixel_blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":793
 *         return 0
 * 
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

static PyObject *__pyx_pw_5renpy_7display_6render_6Render_13absolute_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5renpy_7display_6render_6Render_absolute_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit *__pyx_optional_args) {
  PyObject *__pyx_v_focus = ((PyObject *)Py_True);
  PyObject *__pyx_v_main = ((PyObject *)Py_True);
  PyObject *__pyx_v_index = ((PyObject *)Py_None);
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("absolute_blit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_focus = __pyx_optional_args->focus;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_main = __pyx_optional_args->main;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_index = __pyx_optional_args->index;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_absolute_blit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_13absolute_blit)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_source);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_INCREF(__pyx_v_pos);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_pos);
      __Pyx_GIVEREF(__pyx_v_pos);
      __Pyx_INCREF(__pyx_v_focus);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_focus);
      __Pyx_GIVEREF(__pyx_v_focus);
      __Pyx_INCREF(__pyx_v_main);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_main);
      __Pyx_GIVEREF(__pyx_v_main);
      __Pyx_INCREF(__pyx_v_index);
      PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_5, __pyx_v_index);
      __Pyx_GIVEREF(__pyx_v_index);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_7;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":804
 *         """
 * 
 *         (xo, yo) = pos             # <<<<<<<<<<<<<<
 * 
 *         xo = renpy.display.core.absolute(xo)
 */
  if (likely(__pyx_v_pos != Py_None)) {
    PyObject* sequence = __pyx_v_pos;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    #endif
  } else {
    __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_v_xo = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_yo = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":806
 *         (xo, yo) = pos
 * 
 *         xo = renpy.display.core.absolute(xo)             # <<<<<<<<<<<<<<
 *         yo = renpy.display.core.absolute(yo)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_core); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_absolute); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_xo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_xo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":807
 * 
 *         xo = renpy.display.core.absolute(xo)
 *         yo = renpy.display.core.absolute(yo)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_display); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_core); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_absolute); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_yo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF_SET(__pyx_v_yo, __pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":809
 *         yo = renpy.display.core.absolute(yo)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 */
  __pyx_t_8 = (__pyx_v_index == Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

    /* "renpy/display/render.pyx":810
 * 
 *         if index is None:
 *             self.children.append((source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->children, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":812
 *             self.children.append((source, xo, yo, focus, main))
 *         else:
 *             self.children.insert(index, (source, xo, yo, focus, main))             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(source, Render):
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "insert");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_source);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
    __Pyx_GIVEREF(__pyx_v_source);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_INCREF(__pyx_v_focus);
    PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_focus);
    __Pyx_GIVEREF(__pyx_v_focus);
    __Pyx_INCREF(__pyx_v_main);
    PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_main);
    __Pyx_GIVEREF(__pyx_v_main);
    __pyx_t_10 = PyList_Insert(__pyx_v_self->children, __pyx_t_5, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":814
 *             self.children.insert(index, (source, xo, yo, focus, main))
 * 
 *         if isinstance(source, Render):             # <<<<<<<<<<<<<<
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)
 */
  __pyx_t_9 = __Pyx_TypeCheck(__pyx_v_source, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

    /* "renpy/display/render.pyx":815
 * 
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)             # <<<<<<<<<<<<<<
 *             source.parents.add(self)
 * 
 */
    if (unlikely(__pyx_v_self->depends_on_list == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->depends_on_list, __pyx_v_source); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":816
 *         if isinstance(source, Render):
 *             self.depends_on_list.append(source)
 *             source.parents.add(self)             # <<<<<<<<<<<<<<
 * 
 *         return 0
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_parents); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":818
 *             source.parents.add(self)
 * 
 *         return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":793
 *         return 0
 * 
 *     cpdef int absolute_blit(Render self, source, tuple pos, object focus=True, object main=True, object index=None):             # <<<<<<<<<<<<<<
 *         """
 *         Blits `source` (a Render or Surface) to this Render, offset by
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("renpy.display.render.Render.absolute_blit", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_13absolute_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_12absolute_blit[] = "\n        Blits `source` (a Render or Surface) to this Render, offset by\n        xo and yo.\n\n        If `focus` is true, then focuses are added from the child to the\n        parent.\n\n        This blits at fractional pixel boundaries.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_13absolute_blit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_focus = 0;
  PyObject *__pyx_v_main = 0;
  PyObject *__pyx_v_index = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("absolute_blit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_pos,&__pyx_n_s_focus,&__pyx_n_s_main,&__pyx_n_s_index,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("absolute_blit", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focus);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_main);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "absolute_blit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_pos = ((PyObject*)values[1]);
    __pyx_v_focus = values[2];
    __pyx_v_main = values[3];
    __pyx_v_index = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("absolute_blit", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.absolute_blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pos), (&PyTuple_Type), 1, "pos", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12absolute_blit(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_source, __pyx_v_pos, __pyx_v_focus, __pyx_v_main, __pyx_v_index);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12absolute_blit(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_pos, PyObject *__pyx_v_focus, PyObject *__pyx_v_main, PyObject *__pyx_v_index) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("absolute_blit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.focus = __pyx_v_focus;
  __pyx_t_2.main = __pyx_v_main;
  __pyx_t_2.index = __pyx_v_index;
  __pyx_t_1 = __pyx_vtabptr_5renpy_7display_6render_Render->absolute_blit(__pyx_v_self, __pyx_v_source, __pyx_v_pos, 1, &__pyx_t_2); 
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.Render.absolute_blit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":821
 * 
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the size of this Render, a mostly ficticious value
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_14get_size[] = "\n        Returns the size of this Render, a mostly ficticious value\n        that's taken from the inputs to the constructor. (As in, we\n        don't clip to this size.)\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15get_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_size (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_14get_size(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_14get_size(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_size", 0);

  /* "renpy/display/render.pyx":828
 *         """
 * 
 *         return self.width, self.height             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":821
 * 
 * 
 *     def get_size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the size of this Render, a mostly ficticious value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("renpy.display.render.Render.get_size", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":831
 * 
 * 
 *     def render_to_texture(self, alpha=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a texture constructed from this render. This may return
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_17render_to_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_16render_to_texture[] = "\n        Returns a texture constructed from this render. This may return\n        a cached texture, if one has already been rendered.\n\n        `alpha` is a hint that controls if the surface should have\n        alpha or not.\n\n        This returns a texture that's at the drawable resolution, which\n        may be bigger than the virtual resolution. Use renpy.display.draw.draw_to_virt\n        and draw.virt_to_draw to convert between the two resolutions. (For example,\n        multiply reverse by draw_to_virt to scale this down for blitting.)\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_17render_to_texture(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_alpha = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("render_to_texture (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_alpha,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "render_to_texture") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_alpha = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("render_to_texture", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.render_to_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_16render_to_texture(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_alpha);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_16render_to_texture(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_alpha) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("render_to_texture", 0);

  /* "renpy/display/render.pyx":845
 *         """
 * 
 *         if alpha:             # <<<<<<<<<<<<<<
 *             if self.alpha_surface is not None:
 *                 return self.alpha_surface
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_alpha); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":846
 * 
 *         if alpha:
 *             if self.alpha_surface is not None:             # <<<<<<<<<<<<<<
 *                 return self.alpha_surface
 *         else:
 */
    __pyx_t_1 = (__pyx_v_self->alpha_surface != Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":847
 *         if alpha:
 *             if self.alpha_surface is not None:
 *                 return self.alpha_surface             # <<<<<<<<<<<<<<
 *         else:
 *             if self.surface is not None:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->alpha_surface);
      __pyx_r = __pyx_v_self->alpha_surface;
      goto __pyx_L0;
    }
    goto __pyx_L3;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":849
 *                 return self.alpha_surface
 *         else:
 *             if self.surface is not None:             # <<<<<<<<<<<<<<
 *                 return self.surface
 * 
 */
    __pyx_t_2 = (__pyx_v_self->surface != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":850
 *         else:
 *             if self.surface is not None:
 *                 return self.surface             # <<<<<<<<<<<<<<
 * 
 *         rv = renpy.display.draw.render_to_texture(self, alpha)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->surface);
      __pyx_r = __pyx_v_self->surface;
      goto __pyx_L0;
    }
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":852
 *                 return self.surface
 * 
 *         rv = renpy.display.draw.render_to_texture(self, alpha)             # <<<<<<<<<<<<<<
 * 
 *         # Stash and return the surface.
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_draw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_alpha);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_alpha);
  __Pyx_GIVEREF(__pyx_v_alpha);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_rv = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":855
 * 
 *         # Stash and return the surface.
 *         if alpha:             # <<<<<<<<<<<<<<
 *             self.alpha_surface = rv
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_alpha); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":856
 *         # Stash and return the surface.
 *         if alpha:
 *             self.alpha_surface = rv             # <<<<<<<<<<<<<<
 *         else:
 *             self.surface = rv
 */
    __Pyx_INCREF(__pyx_v_rv);
    __Pyx_GIVEREF(__pyx_v_rv);
    __Pyx_GOTREF(__pyx_v_self->alpha_surface);
    __Pyx_DECREF(__pyx_v_self->alpha_surface);
    __pyx_v_self->alpha_surface = __pyx_v_rv;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":858
 *             self.alpha_surface = rv
 *         else:
 *             self.surface = rv             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
    __Pyx_INCREF(__pyx_v_rv);
    __Pyx_GIVEREF(__pyx_v_rv);
    __Pyx_GOTREF(__pyx_v_self->surface);
    __Pyx_DECREF(__pyx_v_self->surface);
    __pyx_v_self->surface = __pyx_v_rv;
  }
  __pyx_L6:;

  /* "renpy/display/render.pyx":860
 *             self.surface = rv
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 *     pygame_surface = render_to_texture
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":831
 * 
 * 
 *     def render_to_texture(self, alpha=True):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a texture constructed from this render. This may return
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.render_to_texture", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":864
 *     pygame_surface = render_to_texture
 * 
 *     def subsurface(self, rect, focus=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a subsurface of this render. If `focus` is true, then
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_19subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_18subsurface[] = "\n        Returns a subsurface of this render. If `focus` is true, then\n        the focuses are copied from this render to the child.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_19subsurface(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_rect = 0;
  PyObject *__pyx_v_focus = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("subsurface (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rect,&__pyx_n_s_focus,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focus);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "subsurface") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_rect = values[0];
    __pyx_v_focus = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("subsurface", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_18subsurface(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_rect, __pyx_v_focus);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_18subsurface(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_rect, PyObject *__pyx_v_focus) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_rv = NULL;
  struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_reverse = NULL;
  PyObject *__pyx_v_tx = NULL;
  PyObject *__pyx_v_ty = NULL;
  PyObject *__pyx_v_tw = NULL;
  PyObject *__pyx_v_th = NULL;
  PyObject *__pyx_v_rw = NULL;
  PyObject *__pyx_v_rh = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_cx = NULL;
  PyObject *__pyx_v_cy = NULL;
  PyObject *__pyx_v_cfocus = NULL;
  PyObject *__pyx_v_cmain = NULL;
  PyObject *__pyx_v_childw = NULL;
  PyObject *__pyx_v_childh = NULL;
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_cw = NULL;
  PyObject *__pyx_v_yo = NULL;
  PyObject *__pyx_v_ch = NULL;
  PyObject *__pyx_v_offset = NULL;
  PyObject *__pyx_v_crop = NULL;
  PyObject *__pyx_v_cropw = NULL;
  PyObject *__pyx_v_croph = NULL;
  PyObject *__pyx_v_newchild = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_fw = NULL;
  PyObject *__pyx_v_fh = NULL;
  PyObject *__pyx_v_mx = NULL;
  PyObject *__pyx_v_my = NULL;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v_mw = NULL;
  PyObject *__pyx_v_mh = NULL;
  PyObject *__pyx_v_mcx = NULL;
  PyObject *__pyx_v_mcy = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  struct __pyx_opt_args_5renpy_7display_6render_6Render_blit __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  Py_ssize_t __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *__pyx_t_23 = NULL;
  double __pyx_t_24;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("subsurface", 0);

  /* "renpy/display/render.pyx":870
 *         """
 * 
 *         (x, y, w, h) = rect             # <<<<<<<<<<<<<<
 * 
 *         x = int(x)
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_rect))) || (PyList_CheckExact(__pyx_v_rect))) {
    PyObject* sequence = __pyx_v_rect;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 4)) {
      if (size > 4) __Pyx_RaiseTooManyValuesError(4);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4};
      for (i=0; i < 4; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4};
    __pyx_t_5 = PyObject_GetIter(__pyx_v_rect); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    for (index=0; index < 4; index++) {
      PyObject* item = __pyx_t_6(__pyx_t_5); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_y = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_w = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_h = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":872
 *         (x, y, w, h) = rect
 * 
 *         x = int(x)             # <<<<<<<<<<<<<<
 *         y = int(y)
 *         w = int(w)
 */
  __pyx_t_4 = PyNumber_Int(__pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":873
 * 
 *         x = int(x)
 *         y = int(y)             # <<<<<<<<<<<<<<
 *         w = int(w)
 *         h = int(h)
 */
  __pyx_t_4 = PyNumber_Int(__pyx_v_y); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":874
 *         x = int(x)
 *         y = int(y)
 *         w = int(w)             # <<<<<<<<<<<<<<
 *         h = int(h)
 * 
 */
  __pyx_t_4 = PyNumber_Int(__pyx_v_w); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_w, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":875
 *         y = int(y)
 *         w = int(w)
 *         h = int(h)             # <<<<<<<<<<<<<<
 * 
 *         rv = Render(w, h)
 */
  __pyx_t_4 = PyNumber_Int(__pyx_v_h); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF_SET(__pyx_v_h, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":877
 *         h = int(h)
 * 
 *         rv = Render(w, h)             # <<<<<<<<<<<<<<
 * 
 *         reverse = self.reverse
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_rv = ((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":879
 *         rv = Render(w, h)
 * 
 *         reverse = self.reverse             # <<<<<<<<<<<<<<
 * 
 *         # This code doesn't work. We need to do the clipping in the screen
 */
  __pyx_t_3 = ((PyObject *)__pyx_v_self->reverse);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_v_reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":912
 * #             rv.forward = Matrix2D(1.0 / xdx, 0.0, 0.0, 1.0 / ydy)
 * 
 *         if ((reverse is not None) and             # <<<<<<<<<<<<<<
 *             (reverse.xdx != 1.0 or
 *             reverse.xdy != 0.0 or
 */
  __pyx_t_8 = (((PyObject *)__pyx_v_reverse) != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }

  /* "renpy/display/render.pyx":913
 * 
 *         if ((reverse is not None) and
 *             (reverse.xdx != 1.0 or             # <<<<<<<<<<<<<<
 *             reverse.xdy != 0.0 or
 *             reverse.ydx != 0.0 or
 */
  __pyx_t_9 = ((__pyx_v_reverse->xdx != 1.0) != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }

  /* "renpy/display/render.pyx":914
 *         if ((reverse is not None) and
 *             (reverse.xdx != 1.0 or
 *             reverse.xdy != 0.0 or             # <<<<<<<<<<<<<<
 *             reverse.ydx != 0.0 or
 *             reverse.ydy != 1.0)):
 */
  __pyx_t_9 = ((__pyx_v_reverse->xdy != 0.0) != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }

  /* "renpy/display/render.pyx":915
 *             (reverse.xdx != 1.0 or
 *             reverse.xdy != 0.0 or
 *             reverse.ydx != 0.0 or             # <<<<<<<<<<<<<<
 *             reverse.ydy != 1.0)):
 * 
 */
  __pyx_t_9 = ((__pyx_v_reverse->ydx != 0.0) != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_7 = __pyx_t_9;
    goto __pyx_L6_bool_binop_done;
  }

  /* "renpy/display/render.pyx":916
 *             reverse.xdy != 0.0 or
 *             reverse.ydx != 0.0 or
 *             reverse.ydy != 1.0)):             # <<<<<<<<<<<<<<
 * 
 *             # This doesn't actually make a subsurface, as we can't easily do
 */
  __pyx_t_9 = ((__pyx_v_reverse->ydy != 1.0) != 0);
  __pyx_t_7 = __pyx_t_9;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_7) {

    /* "renpy/display/render.pyx":921
 *             # so for non-rectangle-aligned renders.
 * 
 *             rv.xclipping = True             # <<<<<<<<<<<<<<
 *             rv.yclipping = True
 * 
 */
    __pyx_v_rv->xclipping = 1;

    /* "renpy/display/render.pyx":922
 * 
 *             rv.xclipping = True
 *             rv.yclipping = True             # <<<<<<<<<<<<<<
 * 
 *             # Try to avoid clipping if a surface fits entirely inside the
 */
    __pyx_v_rv->yclipping = 1;

    /* "renpy/display/render.pyx":927
 *             # rectangle.
 * 
 *             if (reverse.xdx > 0.0 and             # <<<<<<<<<<<<<<
 *                 reverse.xdy == 0.0 and
 *                 reverse.ydx == 0.0 and
 */
    __pyx_t_9 = ((__pyx_v_reverse->xdx > 0.0) != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L12_bool_binop_done;
    }

    /* "renpy/display/render.pyx":928
 * 
 *             if (reverse.xdx > 0.0 and
 *                 reverse.xdy == 0.0 and             # <<<<<<<<<<<<<<
 *                 reverse.ydx == 0.0 and
 *                 reverse.ydy > 0.0):
 */
    __pyx_t_9 = ((__pyx_v_reverse->xdy == 0.0) != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L12_bool_binop_done;
    }

    /* "renpy/display/render.pyx":929
 *             if (reverse.xdx > 0.0 and
 *                 reverse.xdy == 0.0 and
 *                 reverse.ydx == 0.0 and             # <<<<<<<<<<<<<<
 *                 reverse.ydy > 0.0):
 * 
 */
    __pyx_t_9 = ((__pyx_v_reverse->ydx == 0.0) != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L12_bool_binop_done;
    }

    /* "renpy/display/render.pyx":930
 *                 reverse.xdy == 0.0 and
 *                 reverse.ydx == 0.0 and
 *                 reverse.ydy > 0.0):             # <<<<<<<<<<<<<<
 * 
 *                 tx, ty = self.forward.transform(x, y)
 */
    __pyx_t_9 = ((__pyx_v_reverse->ydy > 0.0) != 0);
    __pyx_t_7 = __pyx_t_9;
    __pyx_L12_bool_binop_done:;
    if (__pyx_t_7) {

      /* "renpy/display/render.pyx":932
 *                 reverse.ydy > 0.0):
 * 
 *                 tx, ty = self.forward.transform(x, y)             # <<<<<<<<<<<<<<
 *                 tw, th = self.forward.transform(w + x, h + y)
 *                 rw, rh = self.forward.transform(self.width, self.height)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_1 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (__pyx_t_2) {
        PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_10, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __Pyx_INCREF(__pyx_v_y);
      PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_10, __pyx_v_y);
      __Pyx_GIVEREF(__pyx_v_y);
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L17_unpacking_done;
        __pyx_L16_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L17_unpacking_done:;
      }
      __pyx_v_tx = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_v_ty = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "renpy/display/render.pyx":933
 * 
 *                 tx, ty = self.forward.transform(x, y)
 *                 tw, th = self.forward.transform(w + x, h + y)             # <<<<<<<<<<<<<<
 *                 rw, rh = self.forward.transform(self.width, self.height)
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyNumber_Add(__pyx_v_w, __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyNumber_Add(__pyx_v_h, __pyx_v_y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_5) {
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_4 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_11);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_11 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_11)) goto __pyx_L18_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L19_unpacking_done;
        __pyx_L18_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L19_unpacking_done:;
      }
      __pyx_v_tw = __pyx_t_1;
      __pyx_t_1 = 0;
      __pyx_v_th = __pyx_t_11;
      __pyx_t_11 = 0;

      /* "renpy/display/render.pyx":934
 *                 tx, ty = self.forward.transform(x, y)
 *                 tw, th = self.forward.transform(w + x, h + y)
 *                 rw, rh = self.forward.transform(self.width, self.height)             # <<<<<<<<<<<<<<
 * 
 *                 if (tx <= 0) and (tw >= rw):
 */
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = NULL;
      __pyx_t_10 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_11, function);
          __pyx_t_10 = 1;
        }
      }
      __pyx_t_5 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_10, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_10, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
        index = 0; __pyx_t_11 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_11)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_11);
        index = 1; __pyx_t_5 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L21_unpacking_done;
        __pyx_L20_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L21_unpacking_done:;
      }
      __pyx_v_rw = __pyx_t_11;
      __pyx_t_11 = 0;
      __pyx_v_rh = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":936
 *                 rw, rh = self.forward.transform(self.width, self.height)
 * 
 *                 if (tx <= 0) and (tw >= rw):             # <<<<<<<<<<<<<<
 *                     rv.xclipping = False
 * 
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_tx, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_9) {
      } else {
        __pyx_t_7 = __pyx_t_9;
        goto __pyx_L23_bool_binop_done;
      }
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_tw, __pyx_v_rw, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __pyx_t_9;
      __pyx_L23_bool_binop_done:;
      if (__pyx_t_7) {

        /* "renpy/display/render.pyx":937
 * 
 *                 if (tx <= 0) and (tw >= rw):
 *                     rv.xclipping = False             # <<<<<<<<<<<<<<
 * 
 *                 if (ty <= 0) and (th >= rh):
 */
        __pyx_v_rv->xclipping = 0;
        goto __pyx_L22;
      }
      __pyx_L22:;

      /* "renpy/display/render.pyx":939
 *                     rv.xclipping = False
 * 
 *                 if (ty <= 0) and (th >= rh):             # <<<<<<<<<<<<<<
 *                     rv.yclipping = False
 * 
 */
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_ty, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_9) {
      } else {
        __pyx_t_7 = __pyx_t_9;
        goto __pyx_L26_bool_binop_done;
      }
      __pyx_t_3 = PyObject_RichCompare(__pyx_v_th, __pyx_v_rh, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __pyx_t_9;
      __pyx_L26_bool_binop_done:;
      if (__pyx_t_7) {

        /* "renpy/display/render.pyx":940
 * 
 *                 if (ty <= 0) and (th >= rh):
 *                     rv.yclipping = False             # <<<<<<<<<<<<<<
 * 
 *             rv.blit(self, (-x, -y), focus=focus, main=True)
 */
        __pyx_v_rv->yclipping = 0;
        goto __pyx_L25;
      }
      __pyx_L25:;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "renpy/display/render.pyx":942
 *                     rv.yclipping = False
 * 
 *             rv.blit(self, (-x, -y), focus=focus, main=True)             # <<<<<<<<<<<<<<
 *             return rv
 * 
 */
    __pyx_t_3 = PyNumber_Negative(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Negative(__pyx_v_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_13.__pyx_n = 2;
    __pyx_t_13.focus = __pyx_v_focus;
    __pyx_t_13.main = Py_True;
    __pyx_t_12 = ((struct __pyx_vtabstruct_5renpy_7display_6render_Render *)__pyx_v_rv->__pyx_vtab)->blit(__pyx_v_rv, ((PyObject *)__pyx_v_self), ((PyObject*)__pyx_t_11), 0, &__pyx_t_13); 
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "renpy/display/render.pyx":943
 * 
 *             rv.blit(self, (-x, -y), focus=focus, main=True)
 *             return rv             # <<<<<<<<<<<<<<
 * 
 *         # This is the path that executes for rectangle-aligned surfaces,
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_rv));
    __pyx_r = ((PyObject *)__pyx_v_rv);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":948
 *         # making an actual subsurface.
 * 
 *         for child, cx, cy, cfocus, cmain in self.children:             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (unlikely(__pyx_v_self->children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_11 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_11); __pyx_t_10 = 0;
  for (;;) {
    if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_11)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_14);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_14};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_3,&__pyx_t_2,&__pyx_t_1,&__pyx_t_4,&__pyx_t_14};
      __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_15)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_6(__pyx_t_15); if (unlikely(!item)) goto __pyx_L30_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_15), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      goto __pyx_L31_unpacking_done;
      __pyx_L30_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L31_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cfocus, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cmain, __pyx_t_14);
    __pyx_t_14 = 0;

    /* "renpy/display/render.pyx":951
 * 
 * 
 *             childw, childh = child.get_size()             # <<<<<<<<<<<<<<
 *             xo, cx, cw = compute_subline(cx, childw, x, w)
 *             yo, cy, ch = compute_subline(cy, childh, y, h)
 */
    __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_get_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext;
      index = 0; __pyx_t_14 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_14)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L32_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L33_unpacking_done;
      __pyx_L32_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L33_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_childw, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_childh, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":952
 * 
 *             childw, childh = child.get_size()
 *             xo, cx, cw = compute_subline(cx, childw, x, w)             # <<<<<<<<<<<<<<
 *             yo, cy, ch = compute_subline(cy, childh, y, h)
 * 
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_14 = NULL;
    __pyx_t_16 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_14)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_16 = 1;
      }
    }
    __pyx_t_1 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_14) {
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
    }
    __Pyx_INCREF(__pyx_v_cx);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_16, __pyx_v_cx);
    __Pyx_GIVEREF(__pyx_v_cx);
    __Pyx_INCREF(__pyx_v_childw);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_16, __pyx_v_childw);
    __Pyx_GIVEREF(__pyx_v_childw);
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_16, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_1, 3+__pyx_t_16, __pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_14);
      #else
      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_14 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 2; __pyx_t_14 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_14)) goto __pyx_L34_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L35_unpacking_done;
      __pyx_L34_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L35_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_cx, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cw, __pyx_t_14);
    __pyx_t_14 = 0;

    /* "renpy/display/render.pyx":953
 *             childw, childh = child.get_size()
 *             xo, cx, cw = compute_subline(cx, childw, x, w)
 *             yo, cy, ch = compute_subline(cy, childh, y, h)             # <<<<<<<<<<<<<<
 * 
 *             if cw <= 0 or ch <= 0 or w - xo <= 0 or h - yo <= 0:
 */
    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_1 = NULL;
    __pyx_t_16 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_14, function);
        __pyx_t_16 = 1;
      }
    }
    __pyx_t_4 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_1) {
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_cy);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_16, __pyx_v_cy);
    __Pyx_GIVEREF(__pyx_v_cy);
    __Pyx_INCREF(__pyx_v_childh);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_16, __pyx_v_childh);
    __Pyx_GIVEREF(__pyx_v_childh);
    __Pyx_INCREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_16, __pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    __Pyx_INCREF(__pyx_v_h);
    PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_16, __pyx_v_h);
    __Pyx_GIVEREF(__pyx_v_h);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_1 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      #else
      __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
      index = 0; __pyx_t_14 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_14)) goto __pyx_L36_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L36_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      index = 2; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L36_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_6 = NULL;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L37_unpacking_done;
      __pyx_L36_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L37_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_DECREF_SET(__pyx_v_cy, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":955
 *             yo, cy, ch = compute_subline(cy, childh, y, h)
 * 
 *             if cw <= 0 or ch <= 0 or w - xo <= 0 or h - yo <= 0:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cw, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L39_bool_binop_done;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_ch, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L39_bool_binop_done;
    }
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_w, __pyx_v_xo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L39_bool_binop_done;
    }
    __pyx_t_1 = PyNumber_Subtract(__pyx_v_h, __pyx_v_yo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_t_9;
    __pyx_L39_bool_binop_done:;
    if (__pyx_t_7) {

      /* "renpy/display/render.pyx":956
 * 
 *             if cw <= 0 or ch <= 0 or w - xo <= 0 or h - yo <= 0:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             if cx < 0 or cx >= childw or cy < 0 or cy >= childh:
 */
      goto __pyx_L28_continue;
    }

    /* "renpy/display/render.pyx":958
 *                 continue
 * 
 *             if cx < 0 or cx >= childw or cy < 0 or cy >= childh:             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cx, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L44_bool_binop_done;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cx, __pyx_v_childw, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L44_bool_binop_done;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cy, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L44_bool_binop_done;
    }
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_cy, __pyx_v_childh, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __pyx_t_9;
    __pyx_L44_bool_binop_done:;
    if (__pyx_t_7) {

      /* "renpy/display/render.pyx":959
 * 
 *             if cx < 0 or cx >= childw or cy < 0 or cy >= childh:
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             offset = (xo, yo)
 */
      goto __pyx_L28_continue;
    }

    /* "renpy/display/render.pyx":961
 *                 continue
 * 
 *             offset = (xo, yo)             # <<<<<<<<<<<<<<
 *             crop = None
 * 
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __Pyx_XDECREF_SET(__pyx_v_offset, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":962
 * 
 *             offset = (xo, yo)
 *             crop = None             # <<<<<<<<<<<<<<
 * 
 *             try:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_XDECREF_SET(__pyx_v_crop, Py_None);

    /* "renpy/display/render.pyx":964
 *             crop = None
 * 
 *             try:             # <<<<<<<<<<<<<<
 *                 if isinstance(child, Render):
 * 
 */
    {
      __Pyx_ExceptionSave(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
      __Pyx_XGOTREF(__pyx_t_17);
      __Pyx_XGOTREF(__pyx_t_18);
      __Pyx_XGOTREF(__pyx_t_19);
      /*try:*/ {

        /* "renpy/display/render.pyx":965
 * 
 *             try:
 *                 if isinstance(child, Render):             # <<<<<<<<<<<<<<
 * 
 *                     if child.xclipping:
 */
        __pyx_t_7 = __Pyx_TypeCheck(__pyx_v_child, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
        __pyx_t_9 = (__pyx_t_7 != 0);
        if (__pyx_t_9) {

          /* "renpy/display/render.pyx":967
 *                 if isinstance(child, Render):
 * 
 *                     if child.xclipping:             # <<<<<<<<<<<<<<
 *                         cropw = cw
 *                     else:
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_xclipping); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_9) {

            /* "renpy/display/render.pyx":968
 * 
 *                     if child.xclipping:
 *                         cropw = cw             # <<<<<<<<<<<<<<
 *                     else:
 *                         cropw = w - xo
 */
            __Pyx_INCREF(__pyx_v_cw);
            __Pyx_XDECREF_SET(__pyx_v_cropw, __pyx_v_cw);
            goto __pyx_L57;
          }
          /*else*/ {

            /* "renpy/display/render.pyx":970
 *                         cropw = cw
 *                     else:
 *                         cropw = w - xo             # <<<<<<<<<<<<<<
 * 
 *                     if child.yclipping:
 */
            __pyx_t_5 = PyNumber_Subtract(__pyx_v_w, __pyx_v_xo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_cropw, __pyx_t_5);
            __pyx_t_5 = 0;
          }
          __pyx_L57:;

          /* "renpy/display/render.pyx":972
 *                         cropw = w - xo
 * 
 *                     if child.yclipping:             # <<<<<<<<<<<<<<
 *                         croph = ch
 *                     else:
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_yclipping); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (__pyx_t_9) {

            /* "renpy/display/render.pyx":973
 * 
 *                     if child.yclipping:
 *                         croph = ch             # <<<<<<<<<<<<<<
 *                     else:
 *                         croph = h - yo
 */
            __Pyx_INCREF(__pyx_v_ch);
            __Pyx_XDECREF_SET(__pyx_v_croph, __pyx_v_ch);
            goto __pyx_L58;
          }
          /*else*/ {

            /* "renpy/display/render.pyx":975
 *                         croph = ch
 *                     else:
 *                         croph = h - yo             # <<<<<<<<<<<<<<
 * 
 *                     crop = (cx, cy, cropw, croph)
 */
            __pyx_t_5 = PyNumber_Subtract(__pyx_v_h, __pyx_v_yo); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_5);
            __Pyx_XDECREF_SET(__pyx_v_croph, __pyx_t_5);
            __pyx_t_5 = 0;
          }
          __pyx_L58:;

          /* "renpy/display/render.pyx":977
 *                         croph = h - yo
 * 
 *                     crop = (cx, cy, cropw, croph)             # <<<<<<<<<<<<<<
 *                     newchild = child.subsurface(crop, focus=focus)
 *                     newchild.width = cw
 */
          __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_INCREF(__pyx_v_cx);
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_cx);
          __Pyx_GIVEREF(__pyx_v_cx);
          __Pyx_INCREF(__pyx_v_cy);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_cy);
          __Pyx_GIVEREF(__pyx_v_cy);
          __Pyx_INCREF(__pyx_v_cropw);
          PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_cropw);
          __Pyx_GIVEREF(__pyx_v_cropw);
          __Pyx_INCREF(__pyx_v_croph);
          PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_croph);
          __Pyx_GIVEREF(__pyx_v_croph);
          __Pyx_DECREF_SET(__pyx_v_crop, __pyx_t_5);
          __pyx_t_5 = 0;

          /* "renpy/display/render.pyx":978
 * 
 *                     crop = (cx, cy, cropw, croph)
 *                     newchild = child.subsurface(crop, focus=focus)             # <<<<<<<<<<<<<<
 *                     newchild.width = cw
 *                     newchild.height = ch
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_crop);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_crop);
          __Pyx_GIVEREF(__pyx_v_crop);
          __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_4);
          if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_focus, __pyx_v_focus) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF_SET(__pyx_v_newchild, __pyx_t_14);
          __pyx_t_14 = 0;

          /* "renpy/display/render.pyx":979
 *                     crop = (cx, cy, cropw, croph)
 *                     newchild = child.subsurface(crop, focus=focus)
 *                     newchild.width = cw             # <<<<<<<<<<<<<<
 *                     newchild.height = ch
 *                     newchild.render_of = child.render_of[:]
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_newchild, __pyx_n_s_width, __pyx_v_cw) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L48_error;}

          /* "renpy/display/render.pyx":980
 *                     newchild = child.subsurface(crop, focus=focus)
 *                     newchild.width = cw
 *                     newchild.height = ch             # <<<<<<<<<<<<<<
 *                     newchild.render_of = child.render_of[:]
 * 
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_newchild, __pyx_n_s_height, __pyx_v_ch) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L48_error;}

          /* "renpy/display/render.pyx":981
 *                     newchild.width = cw
 *                     newchild.height = ch
 *                     newchild.render_of = child.render_of[:]             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_render_of); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_t_14, 0, 0, NULL, NULL, &__pyx_slice__7, 0, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_newchild, __pyx_n_s_render_of, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L56;
        }
        /*else*/ {

          /* "renpy/display/render.pyx":985
 *                 else:
 * 
 *                     crop = (cx, cy, cw, ch)             # <<<<<<<<<<<<<<
 *                     newchild = child.subsurface(crop)
 *                     renpy.display.draw.mutated_surface(newchild)
 */
          __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_INCREF(__pyx_v_cx);
          PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_cx);
          __Pyx_GIVEREF(__pyx_v_cx);
          __Pyx_INCREF(__pyx_v_cy);
          PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_cy);
          __Pyx_GIVEREF(__pyx_v_cy);
          __Pyx_INCREF(__pyx_v_cw);
          PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_cw);
          __Pyx_GIVEREF(__pyx_v_cw);
          __Pyx_INCREF(__pyx_v_ch);
          PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_ch);
          __Pyx_GIVEREF(__pyx_v_ch);
          __Pyx_DECREF_SET(__pyx_v_crop, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "renpy/display/render.pyx":986
 * 
 *                     crop = (cx, cy, cw, ch)
 *                     newchild = child.subsurface(crop)             # <<<<<<<<<<<<<<
 *                     renpy.display.draw.mutated_surface(newchild)
 * 
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_v_crop); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_INCREF(__pyx_v_crop);
            PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_crop);
            __Pyx_GIVEREF(__pyx_v_crop);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF_SET(__pyx_v_newchild, __pyx_t_4);
          __pyx_t_4 = 0;

          /* "renpy/display/render.pyx":987
 *                     crop = (cx, cy, cw, ch)
 *                     newchild = child.subsurface(crop)
 *                     renpy.display.draw.mutated_surface(newchild)             # <<<<<<<<<<<<<<
 * 
 *             except:
 */
          __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_draw); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_mutated_surface); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_5);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_5, function);
            }
          }
          if (!__pyx_t_14) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_newchild); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_1);
            PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
            __Pyx_INCREF(__pyx_v_newchild);
            PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_newchild);
            __Pyx_GIVEREF(__pyx_v_newchild);
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 987; __pyx_clineno = __LINE__; goto __pyx_L48_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        }
        __pyx_L56:;
      }
      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      goto __pyx_L55_try_end;
      __pyx_L48_error:;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "renpy/display/render.pyx":989
 *                     renpy.display.draw.mutated_surface(newchild)
 * 
 *             except:             # <<<<<<<<<<<<<<
 *                 raise Exception("Creating subsurface failed. child size = ({}, {}), crop = {!r}".format(childw, childh, crop))
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("renpy.display.render.Render.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 989; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_1);

        /* "renpy/display/render.pyx":990
 * 
 *             except:
 *                 raise Exception("Creating subsurface failed. child size = ({}, {}), crop = {!r}".format(childw, childh, crop))             # <<<<<<<<<<<<<<
 * 
 *             rv.blit(newchild, offset, focus=cfocus, main=cmain)
 */
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Creating_subsurface_failed_child, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = NULL;
        __pyx_t_16 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
          if (likely(__pyx_t_3)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_3);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_2, function);
            __pyx_t_16 = 1;
          }
        }
        __pyx_t_15 = PyTuple_New(3+__pyx_t_16); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_15);
        if (__pyx_t_3) {
          PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
        }
        __Pyx_INCREF(__pyx_v_childw);
        PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_16, __pyx_v_childw);
        __Pyx_GIVEREF(__pyx_v_childw);
        __Pyx_INCREF(__pyx_v_childh);
        PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_16, __pyx_v_childh);
        __Pyx_GIVEREF(__pyx_v_childh);
        __Pyx_INCREF(__pyx_v_crop);
        PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_16, __pyx_v_crop);
        __Pyx_GIVEREF(__pyx_v_crop);
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_15, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_14);
        __Pyx_GIVEREF(__pyx_t_14);
        __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_2, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_Raise(__pyx_t_14, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L50_except_error;}
      }
      __pyx_L50_except_error:;
      __Pyx_XGIVEREF(__pyx_t_17);
      __Pyx_XGIVEREF(__pyx_t_18);
      __Pyx_XGIVEREF(__pyx_t_19);
      __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
      goto __pyx_L1_error;
      __pyx_L55_try_end:;
    }

    /* "renpy/display/render.pyx":992
 *                 raise Exception("Creating subsurface failed. child size = ({}, {}), crop = {!r}".format(childw, childh, crop))
 * 
 *             rv.blit(newchild, offset, focus=cfocus, main=cmain)             # <<<<<<<<<<<<<<
 * 
 *         if focus and self.focuses:
 */
    __pyx_t_13.__pyx_n = 2;
    __pyx_t_13.focus = __pyx_v_cfocus;
    __pyx_t_13.main = __pyx_v_cmain;
    __pyx_t_12 = ((struct __pyx_vtabstruct_5renpy_7display_6render_Render *)__pyx_v_rv->__pyx_vtab)->blit(__pyx_v_rv, __pyx_v_newchild, __pyx_v_offset, 0, &__pyx_t_13); 

    /* "renpy/display/render.pyx":948
 *         # making an actual subsurface.
 * 
 *         for child, cx, cy, cfocus, cmain in self.children:             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_L28_continue:;
  }
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":994
 *             rv.blit(newchild, offset, focus=cfocus, main=cmain)
 * 
 *         if focus and self.focuses:             # <<<<<<<<<<<<<<
 * 
 *             for (d, arg, xo, yo, fw, fh, mx, my, mask) in self.focuses:
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_focus); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_7) {
  } else {
    __pyx_t_9 = __pyx_t_7;
    goto __pyx_L62_bool_binop_done;
  }
  __pyx_t_7 = (__pyx_v_self->focuses != Py_None) && (PyList_GET_SIZE(__pyx_v_self->focuses) != 0);
  __pyx_t_9 = __pyx_t_7;
  __pyx_L62_bool_binop_done:;
  if (__pyx_t_9) {

    /* "renpy/display/render.pyx":996
 *         if focus and self.focuses:
 * 
 *             for (d, arg, xo, yo, fw, fh, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
    if (unlikely(__pyx_v_self->focuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_11 = __pyx_v_self->focuses; __Pyx_INCREF(__pyx_t_11); __pyx_t_10 = 0;
    for (;;) {
      if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_11)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_11, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 9)) {
          if (size > 9) __Pyx_RaiseTooManyValuesError(9);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_2 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_15 = PyTuple_GET_ITEM(sequence, 4); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 5); 
          __pyx_t_20 = PyTuple_GET_ITEM(sequence, 6); 
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 7); 
          __pyx_t_22 = PyTuple_GET_ITEM(sequence, 8); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_2 = PyList_GET_ITEM(sequence, 3); 
          __pyx_t_15 = PyList_GET_ITEM(sequence, 4); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 5); 
          __pyx_t_20 = PyList_GET_ITEM(sequence, 6); 
          __pyx_t_21 = PyList_GET_ITEM(sequence, 7); 
          __pyx_t_22 = PyList_GET_ITEM(sequence, 8); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_15);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_21);
        __Pyx_INCREF(__pyx_t_22);
        #else
        {
          Py_ssize_t i;
          PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_14,&__pyx_t_2,&__pyx_t_15,&__pyx_t_3,&__pyx_t_20,&__pyx_t_21,&__pyx_t_22};
          for (i=0; i < 9; i++) {
            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
        }
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        PyObject** temps[9] = {&__pyx_t_5,&__pyx_t_4,&__pyx_t_14,&__pyx_t_2,&__pyx_t_15,&__pyx_t_3,&__pyx_t_20,&__pyx_t_21,&__pyx_t_22};
        __pyx_t_23 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_23);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_23)->tp_iternext;
        for (index=0; index < 9; index++) {
          PyObject* item = __pyx_t_6(__pyx_t_23); if (unlikely(!item)) goto __pyx_L66_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_23), 9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        goto __pyx_L67_unpacking_done;
        __pyx_L66_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L67_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_14);
      __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_fw, __pyx_t_15);
      __pyx_t_15 = 0;
      __Pyx_XDECREF_SET(__pyx_v_fh, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mx, __pyx_t_20);
      __pyx_t_20 = 0;
      __Pyx_XDECREF_SET(__pyx_v_my, __pyx_t_21);
      __pyx_t_21 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_22);
      __pyx_t_22 = 0;

      /* "renpy/display/render.pyx":998
 *             for (d, arg, xo, yo, fw, fh, mx, my, mask) in self.focuses:
 * 
 *                 if xo is None:             # <<<<<<<<<<<<<<
 *                     rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)
 *                     continue
 */
      __pyx_t_9 = (__pyx_v_xo == Py_None);
      __pyx_t_7 = (__pyx_t_9 != 0);
      if (__pyx_t_7) {

        /* "renpy/display/render.pyx":999
 * 
 *                 if xo is None:
 *                     rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_t_22 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_add_focus); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_22);
        __pyx_t_21 = NULL;
        __pyx_t_16 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_22))) {
          __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_22);
          if (likely(__pyx_t_21)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
            __Pyx_INCREF(__pyx_t_21);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_22, function);
            __pyx_t_16 = 1;
          }
        }
        __pyx_t_20 = PyTuple_New(9+__pyx_t_16); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        if (__pyx_t_21) {
          PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL;
        }
        __Pyx_INCREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_16, __pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        __Pyx_INCREF(__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_16, __pyx_v_arg);
        __Pyx_GIVEREF(__pyx_v_arg);
        __Pyx_INCREF(__pyx_v_xo);
        PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_16, __pyx_v_xo);
        __Pyx_GIVEREF(__pyx_v_xo);
        __Pyx_INCREF(__pyx_v_yo);
        PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_16, __pyx_v_yo);
        __Pyx_GIVEREF(__pyx_v_yo);
        __Pyx_INCREF(__pyx_v_fw);
        PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_16, __pyx_v_fw);
        __Pyx_GIVEREF(__pyx_v_fw);
        __Pyx_INCREF(__pyx_v_fh);
        PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_16, __pyx_v_fh);
        __Pyx_GIVEREF(__pyx_v_fh);
        __Pyx_INCREF(__pyx_v_mx);
        PyTuple_SET_ITEM(__pyx_t_20, 6+__pyx_t_16, __pyx_v_mx);
        __Pyx_GIVEREF(__pyx_v_mx);
        __Pyx_INCREF(__pyx_v_my);
        PyTuple_SET_ITEM(__pyx_t_20, 7+__pyx_t_16, __pyx_v_my);
        __Pyx_GIVEREF(__pyx_v_my);
        __Pyx_INCREF(__pyx_v_mask);
        PyTuple_SET_ITEM(__pyx_t_20, 8+__pyx_t_16, __pyx_v_mask);
        __Pyx_GIVEREF(__pyx_v_mask);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "renpy/display/render.pyx":1000
 *                 if xo is None:
 *                     rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 xo, cx, fw = compute_subline(xo, fw, x, w)
 */
        goto __pyx_L64_continue;
      }

      /* "renpy/display/render.pyx":1002
 *                     continue
 * 
 *                 xo, cx, fw = compute_subline(xo, fw, x, w)             # <<<<<<<<<<<<<<
 *                 yo, cy, fh = compute_subline(yo, fh, y, h)
 * 
 */
      __pyx_t_22 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_22);
      __pyx_t_20 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_22))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_22);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_22, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_21 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_21);
      if (__pyx_t_20) {
        PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = NULL;
      }
      __Pyx_INCREF(__pyx_v_xo);
      PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_16, __pyx_v_xo);
      __Pyx_GIVEREF(__pyx_v_xo);
      __Pyx_INCREF(__pyx_v_fw);
      PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_16, __pyx_v_fw);
      __Pyx_GIVEREF(__pyx_v_fw);
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_21, 2+__pyx_t_16, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __Pyx_INCREF(__pyx_v_w);
      PyTuple_SET_ITEM(__pyx_t_21, 3+__pyx_t_16, __pyx_v_w);
      __Pyx_GIVEREF(__pyx_v_w);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_22 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_20 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_22 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_21 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_20 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_22);
        __Pyx_INCREF(__pyx_t_21);
        __Pyx_INCREF(__pyx_t_20);
        #else
        __pyx_t_22 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_22);
        __pyx_t_21 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_20 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
        index = 0; __pyx_t_22 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_22)) goto __pyx_L69_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_22);
        index = 1; __pyx_t_21 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_21)) goto __pyx_L69_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_21);
        index = 2; __pyx_t_20 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_20)) goto __pyx_L69_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_20);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L70_unpacking_done;
        __pyx_L69_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L70_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_xo, __pyx_t_22);
      __pyx_t_22 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_21);
      __pyx_t_21 = 0;
      __Pyx_DECREF_SET(__pyx_v_fw, __pyx_t_20);
      __pyx_t_20 = 0;

      /* "renpy/display/render.pyx":1003
 * 
 *                 xo, cx, fw = compute_subline(xo, fw, x, w)
 *                 yo, cy, fh = compute_subline(yo, fh, y, h)             # <<<<<<<<<<<<<<
 * 
 *                 if fw <= 0 or fh <= 0:
 */
      __pyx_t_20 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_21 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_21)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_21);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_22 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_22);
      if (__pyx_t_21) {
        PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL;
      }
      __Pyx_INCREF(__pyx_v_yo);
      PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_16, __pyx_v_yo);
      __Pyx_GIVEREF(__pyx_v_yo);
      __Pyx_INCREF(__pyx_v_fh);
      PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_16, __pyx_v_fh);
      __Pyx_GIVEREF(__pyx_v_fh);
      __Pyx_INCREF(__pyx_v_y);
      PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_16, __pyx_v_y);
      __Pyx_GIVEREF(__pyx_v_y);
      __Pyx_INCREF(__pyx_v_h);
      PyTuple_SET_ITEM(__pyx_t_22, 3+__pyx_t_16, __pyx_v_h);
      __Pyx_GIVEREF(__pyx_v_h);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
        PyObject* sequence = __pyx_t_1;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_20 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_22 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_21 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_20 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_22 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_21 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_20);
        __Pyx_INCREF(__pyx_t_22);
        __Pyx_INCREF(__pyx_t_21);
        #else
        __pyx_t_20 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        __pyx_t_22 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_22);
        __pyx_t_21 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_21);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
        index = 0; __pyx_t_20 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_20)) goto __pyx_L71_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_20);
        index = 1; __pyx_t_22 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_22)) goto __pyx_L71_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_22);
        index = 2; __pyx_t_21 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_21)) goto __pyx_L71_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_21);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_6 = NULL;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L72_unpacking_done;
        __pyx_L71_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L72_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_yo, __pyx_t_20);
      __pyx_t_20 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_22);
      __pyx_t_22 = 0;
      __Pyx_DECREF_SET(__pyx_v_fh, __pyx_t_21);
      __pyx_t_21 = 0;

      /* "renpy/display/render.pyx":1005
 *                 yo, cy, fh = compute_subline(yo, fh, y, h)
 * 
 *                 if fw <= 0 or fh <= 0:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_fw, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!__pyx_t_9) {
      } else {
        __pyx_t_7 = __pyx_t_9;
        goto __pyx_L74_bool_binop_done;
      }
      __pyx_t_1 = PyObject_RichCompare(__pyx_v_fh, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = __pyx_t_9;
      __pyx_L74_bool_binop_done:;
      if (__pyx_t_7) {

        /* "renpy/display/render.pyx":1006
 * 
 *                 if fw <= 0 or fh <= 0:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 if mx is not None:
 */
        goto __pyx_L64_continue;
      }

      /* "renpy/display/render.pyx":1008
 *                     continue
 * 
 *                 if mx is not None:             # <<<<<<<<<<<<<<
 * 
 *                     mw, mh = mask.get_size()
 */
      __pyx_t_7 = (__pyx_v_mx != Py_None);
      __pyx_t_9 = (__pyx_t_7 != 0);
      if (__pyx_t_9) {

        /* "renpy/display/render.pyx":1010
 *                 if mx is not None:
 * 
 *                     mw, mh = mask.get_size()             # <<<<<<<<<<<<<<
 * 
 *                     mx, mcx, mw = compute_subline(mx, mw, x, w)
 */
        __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_get_size); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_22 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_21))) {
          __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_21);
          if (likely(__pyx_t_22)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
            __Pyx_INCREF(__pyx_t_22);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_21, function);
          }
        }
        if (__pyx_t_22) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_21, __pyx_t_22); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_21); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 2)) {
            if (size > 2) __Pyx_RaiseTooManyValuesError(2);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_22 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_21 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_22 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_21);
          __Pyx_INCREF(__pyx_t_22);
          #else
          __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_21);
          __pyx_t_22 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_22);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_20 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = Py_TYPE(__pyx_t_20)->tp_iternext;
          index = 0; __pyx_t_21 = __pyx_t_6(__pyx_t_20); if (unlikely(!__pyx_t_21)) goto __pyx_L77_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_21);
          index = 1; __pyx_t_22 = __pyx_t_6(__pyx_t_20); if (unlikely(!__pyx_t_22)) goto __pyx_L77_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_22);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_20), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = NULL;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          goto __pyx_L78_unpacking_done;
          __pyx_L77_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __pyx_t_6 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L78_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_v_mw, __pyx_t_21);
        __pyx_t_21 = 0;
        __Pyx_XDECREF_SET(__pyx_v_mh, __pyx_t_22);
        __pyx_t_22 = 0;

        /* "renpy/display/render.pyx":1012
 *                     mw, mh = mask.get_size()
 * 
 *                     mx, mcx, mw = compute_subline(mx, mw, x, w)             # <<<<<<<<<<<<<<
 *                     my, mcy, mh = compute_subline(my, mh, y, h)
 * 
 */
        __pyx_t_22 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_22);
        __pyx_t_21 = NULL;
        __pyx_t_16 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_22))) {
          __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_22);
          if (likely(__pyx_t_21)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_22);
            __Pyx_INCREF(__pyx_t_21);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_22, function);
            __pyx_t_16 = 1;
          }
        }
        __pyx_t_20 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_20);
        if (__pyx_t_21) {
          PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL;
        }
        __Pyx_INCREF(__pyx_v_mx);
        PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_16, __pyx_v_mx);
        __Pyx_GIVEREF(__pyx_v_mx);
        __Pyx_INCREF(__pyx_v_mw);
        PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_16, __pyx_v_mw);
        __Pyx_GIVEREF(__pyx_v_mw);
        __Pyx_INCREF(__pyx_v_x);
        PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_16, __pyx_v_x);
        __Pyx_GIVEREF(__pyx_v_x);
        __Pyx_INCREF(__pyx_v_w);
        PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_16, __pyx_v_w);
        __Pyx_GIVEREF(__pyx_v_w);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_22 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_20 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_21 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_22 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_20 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_21 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_22);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_21);
          #else
          __pyx_t_22 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_22);
          __pyx_t_20 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_21 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_21);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
          index = 0; __pyx_t_22 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_22)) goto __pyx_L79_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_22);
          index = 1; __pyx_t_20 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_20)) goto __pyx_L79_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_20);
          index = 2; __pyx_t_21 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_21)) goto __pyx_L79_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_21);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = NULL;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L80_unpacking_done;
          __pyx_L79_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L80_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_mx, __pyx_t_22);
        __pyx_t_22 = 0;
        __Pyx_XDECREF_SET(__pyx_v_mcx, __pyx_t_20);
        __pyx_t_20 = 0;
        __Pyx_DECREF_SET(__pyx_v_mw, __pyx_t_21);
        __pyx_t_21 = 0;

        /* "renpy/display/render.pyx":1013
 * 
 *                     mx, mcx, mw = compute_subline(mx, mw, x, w)
 *                     my, mcy, mh = compute_subline(my, mh, y, h)             # <<<<<<<<<<<<<<
 * 
 *                     if mw <= 0 or mh <= 0:
 */
        __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s_compute_subline); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_21);
        __pyx_t_20 = NULL;
        __pyx_t_16 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_21))) {
          __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_21);
          if (likely(__pyx_t_20)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_21);
            __Pyx_INCREF(__pyx_t_20);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_21, function);
            __pyx_t_16 = 1;
          }
        }
        __pyx_t_22 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_22);
        if (__pyx_t_20) {
          PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = NULL;
        }
        __Pyx_INCREF(__pyx_v_my);
        PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_16, __pyx_v_my);
        __Pyx_GIVEREF(__pyx_v_my);
        __Pyx_INCREF(__pyx_v_mh);
        PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_16, __pyx_v_mh);
        __Pyx_GIVEREF(__pyx_v_mh);
        __Pyx_INCREF(__pyx_v_y);
        PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_16, __pyx_v_y);
        __Pyx_GIVEREF(__pyx_v_y);
        __Pyx_INCREF(__pyx_v_h);
        PyTuple_SET_ITEM(__pyx_t_22, 3+__pyx_t_16, __pyx_v_h);
        __Pyx_GIVEREF(__pyx_v_h);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_21, __pyx_t_22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
          PyObject* sequence = __pyx_t_1;
          #if CYTHON_COMPILING_IN_CPYTHON
          Py_ssize_t size = Py_SIZE(sequence);
          #else
          Py_ssize_t size = PySequence_Size(sequence);
          #endif
          if (unlikely(size != 3)) {
            if (size > 3) __Pyx_RaiseTooManyValuesError(3);
            else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          #if CYTHON_COMPILING_IN_CPYTHON
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_21 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_22 = PyTuple_GET_ITEM(sequence, 1); 
            __pyx_t_20 = PyTuple_GET_ITEM(sequence, 2); 
          } else {
            __pyx_t_21 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_22 = PyList_GET_ITEM(sequence, 1); 
            __pyx_t_20 = PyList_GET_ITEM(sequence, 2); 
          }
          __Pyx_INCREF(__pyx_t_21);
          __Pyx_INCREF(__pyx_t_22);
          __Pyx_INCREF(__pyx_t_20);
          #else
          __pyx_t_21 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_21);
          __pyx_t_22 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_22);
          __pyx_t_20 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_6 = Py_TYPE(__pyx_t_3)->tp_iternext;
          index = 0; __pyx_t_21 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_21)) goto __pyx_L81_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_21);
          index = 1; __pyx_t_22 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_22)) goto __pyx_L81_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_22);
          index = 2; __pyx_t_20 = __pyx_t_6(__pyx_t_3); if (unlikely(!__pyx_t_20)) goto __pyx_L81_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_20);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_6 = NULL;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L82_unpacking_done;
          __pyx_L81_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_6 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_L82_unpacking_done:;
        }
        __Pyx_DECREF_SET(__pyx_v_my, __pyx_t_21);
        __pyx_t_21 = 0;
        __Pyx_XDECREF_SET(__pyx_v_mcy, __pyx_t_22);
        __pyx_t_22 = 0;
        __Pyx_DECREF_SET(__pyx_v_mh, __pyx_t_20);
        __pyx_t_20 = 0;

        /* "renpy/display/render.pyx":1015
 *                     my, mcy, mh = compute_subline(my, mh, y, h)
 * 
 *                     if mw <= 0 or mh <= 0:             # <<<<<<<<<<<<<<
 *                         mx = None
 *                         my = None
 */
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_mw, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (!__pyx_t_7) {
        } else {
          __pyx_t_9 = __pyx_t_7;
          goto __pyx_L84_bool_binop_done;
        }
        __pyx_t_1 = PyObject_RichCompare(__pyx_v_mh, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_9 = __pyx_t_7;
        __pyx_L84_bool_binop_done:;
        if (__pyx_t_9) {

          /* "renpy/display/render.pyx":1016
 * 
 *                     if mw <= 0 or mh <= 0:
 *                         mx = None             # <<<<<<<<<<<<<<
 *                         my = None
 *                         mask = None
 */
          __Pyx_INCREF(Py_None);
          __Pyx_DECREF_SET(__pyx_v_mx, Py_None);

          /* "renpy/display/render.pyx":1017
 *                     if mw <= 0 or mh <= 0:
 *                         mx = None
 *                         my = None             # <<<<<<<<<<<<<<
 *                         mask = None
 *                     else:
 */
          __Pyx_INCREF(Py_None);
          __Pyx_DECREF_SET(__pyx_v_my, Py_None);

          /* "renpy/display/render.pyx":1018
 *                         mx = None
 *                         my = None
 *                         mask = None             # <<<<<<<<<<<<<<
 *                     else:
 *                         mask = mask.subsurface((mcx, mcy, mw, mh))
 */
          __Pyx_INCREF(Py_None);
          __Pyx_DECREF_SET(__pyx_v_mask, Py_None);
          goto __pyx_L83;
        }
        /*else*/ {

          /* "renpy/display/render.pyx":1020
 *                         mask = None
 *                     else:
 *                         mask = mask.subsurface((mcx, mcy, mw, mh))             # <<<<<<<<<<<<<<
 * 
 *                 rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)
 */
          __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_subsurface); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_22 = PyTuple_New(4); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_INCREF(__pyx_v_mcx);
          PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_v_mcx);
          __Pyx_GIVEREF(__pyx_v_mcx);
          __Pyx_INCREF(__pyx_v_mcy);
          PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_v_mcy);
          __Pyx_GIVEREF(__pyx_v_mcy);
          __Pyx_INCREF(__pyx_v_mw);
          PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_v_mw);
          __Pyx_GIVEREF(__pyx_v_mw);
          __Pyx_INCREF(__pyx_v_mh);
          PyTuple_SET_ITEM(__pyx_t_22, 3, __pyx_v_mh);
          __Pyx_GIVEREF(__pyx_v_mh);
          __pyx_t_21 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_20))) {
            __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_20);
            if (likely(__pyx_t_21)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
              __Pyx_INCREF(__pyx_t_21);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_20, function);
            }
          }
          if (!__pyx_t_21) {
            __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_20, __pyx_t_22); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
            __Pyx_GOTREF(__pyx_t_1);
          } else {
            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_3);
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21); __Pyx_GIVEREF(__pyx_t_21); __pyx_t_21 = NULL;
            PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_22);
            __Pyx_GIVEREF(__pyx_t_22);
            __pyx_t_22 = 0;
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
          __pyx_t_1 = 0;
        }
        __pyx_L83:;
        goto __pyx_L76;
      }
      __pyx_L76:;

      /* "renpy/display/render.pyx":1022
 *                         mask = mask.subsurface((mcx, mcy, mw, mh))
 * 
 *                 rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)             # <<<<<<<<<<<<<<
 * 
 *         rv.depends_on(self)
 */
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_add_focus); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_3 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_20))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_20);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_20, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_22 = PyTuple_New(9+__pyx_t_16); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_22);
      if (__pyx_t_3) {
        PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_22, 0+__pyx_t_16, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      __Pyx_INCREF(__pyx_v_arg);
      PyTuple_SET_ITEM(__pyx_t_22, 1+__pyx_t_16, __pyx_v_arg);
      __Pyx_GIVEREF(__pyx_v_arg);
      __Pyx_INCREF(__pyx_v_xo);
      PyTuple_SET_ITEM(__pyx_t_22, 2+__pyx_t_16, __pyx_v_xo);
      __Pyx_GIVEREF(__pyx_v_xo);
      __Pyx_INCREF(__pyx_v_yo);
      PyTuple_SET_ITEM(__pyx_t_22, 3+__pyx_t_16, __pyx_v_yo);
      __Pyx_GIVEREF(__pyx_v_yo);
      __Pyx_INCREF(__pyx_v_fw);
      PyTuple_SET_ITEM(__pyx_t_22, 4+__pyx_t_16, __pyx_v_fw);
      __Pyx_GIVEREF(__pyx_v_fw);
      __Pyx_INCREF(__pyx_v_fh);
      PyTuple_SET_ITEM(__pyx_t_22, 5+__pyx_t_16, __pyx_v_fh);
      __Pyx_GIVEREF(__pyx_v_fh);
      __Pyx_INCREF(__pyx_v_mx);
      PyTuple_SET_ITEM(__pyx_t_22, 6+__pyx_t_16, __pyx_v_mx);
      __Pyx_GIVEREF(__pyx_v_mx);
      __Pyx_INCREF(__pyx_v_my);
      PyTuple_SET_ITEM(__pyx_t_22, 7+__pyx_t_16, __pyx_v_my);
      __Pyx_GIVEREF(__pyx_v_my);
      __Pyx_INCREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_22, 8+__pyx_t_16, __pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_20, __pyx_t_22, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "renpy/display/render.pyx":996
 *         if focus and self.focuses:
 * 
 *             for (d, arg, xo, yo, fw, fh, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
      __pyx_L64_continue:;
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L61;
  }
  __pyx_L61:;

  /* "renpy/display/render.pyx":1024
 *                 rv.add_focus(d, arg, xo, yo, fw, fh, mx, my, mask)
 * 
 *         rv.depends_on(self)             # <<<<<<<<<<<<<<
 *         rv.alpha = self.alpha
 *         rv.operation = self.operation
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_rv), __pyx_n_s_depends_on); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_20 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_20)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_20);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_20) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
  } else {
    __pyx_t_22 = PyTuple_New(1+1); if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_22);
    PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_20); __Pyx_GIVEREF(__pyx_t_20); __pyx_t_20 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_22, 0+1, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_22, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":1025
 * 
 *         rv.depends_on(self)
 *         rv.alpha = self.alpha             # <<<<<<<<<<<<<<
 *         rv.operation = self.operation
 *         rv.operation_alpha = self.operation_alpha
 */
  __pyx_t_24 = __pyx_v_self->alpha;
  __pyx_v_rv->alpha = __pyx_t_24;

  /* "renpy/display/render.pyx":1026
 *         rv.depends_on(self)
 *         rv.alpha = self.alpha
 *         rv.operation = self.operation             # <<<<<<<<<<<<<<
 *         rv.operation_alpha = self.operation_alpha
 *         rv.operation_complete = self.operation_complete
 */
  __pyx_t_12 = __pyx_v_self->operation;
  __pyx_v_rv->operation = __pyx_t_12;

  /* "renpy/display/render.pyx":1027
 *         rv.alpha = self.alpha
 *         rv.operation = self.operation
 *         rv.operation_alpha = self.operation_alpha             # <<<<<<<<<<<<<<
 *         rv.operation_complete = self.operation_complete
 *         rv.nearest = self.nearest
 */
  __pyx_t_9 = __pyx_v_self->operation_alpha;
  __pyx_v_rv->operation_alpha = __pyx_t_9;

  /* "renpy/display/render.pyx":1028
 *         rv.operation = self.operation
 *         rv.operation_alpha = self.operation_alpha
 *         rv.operation_complete = self.operation_complete             # <<<<<<<<<<<<<<
 *         rv.nearest = self.nearest
 *         rv.text_input =  self.text_input
 */
  __pyx_t_24 = __pyx_v_self->operation_complete;
  __pyx_v_rv->operation_complete = __pyx_t_24;

  /* "renpy/display/render.pyx":1029
 *         rv.operation_alpha = self.operation_alpha
 *         rv.operation_complete = self.operation_complete
 *         rv.nearest = self.nearest             # <<<<<<<<<<<<<<
 *         rv.text_input =  self.text_input
 * 
 */
  __pyx_t_11 = __pyx_v_self->nearest;
  __Pyx_INCREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_11);
  __Pyx_GOTREF(__pyx_v_rv->nearest);
  __Pyx_DECREF(__pyx_v_rv->nearest);
  __pyx_v_rv->nearest = __pyx_t_11;
  __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":1030
 *         rv.operation_complete = self.operation_complete
 *         rv.nearest = self.nearest
 *         rv.text_input =  self.text_input             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
  __pyx_t_9 = __pyx_v_self->text_input;
  __pyx_v_rv->text_input = __pyx_t_9;

  /* "renpy/display/render.pyx":1032
 *         rv.text_input =  self.text_input
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_rv));
  __pyx_r = ((PyObject *)__pyx_v_rv);
  goto __pyx_L0;

  /* "renpy/display/render.pyx":864
 *     pygame_surface = render_to_texture
 * 
 *     def subsurface(self, rect, focus=False):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a subsurface of this render. If `focus` is true, then
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_XDECREF(__pyx_t_23);
  __Pyx_AddTraceback("renpy.display.render.Render.subsurface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF((PyObject *)__pyx_v_rv);
  __Pyx_XDECREF((PyObject *)__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_tx);
  __Pyx_XDECREF(__pyx_v_ty);
  __Pyx_XDECREF(__pyx_v_tw);
  __Pyx_XDECREF(__pyx_v_th);
  __Pyx_XDECREF(__pyx_v_rw);
  __Pyx_XDECREF(__pyx_v_rh);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_cx);
  __Pyx_XDECREF(__pyx_v_cy);
  __Pyx_XDECREF(__pyx_v_cfocus);
  __Pyx_XDECREF(__pyx_v_cmain);
  __Pyx_XDECREF(__pyx_v_childw);
  __Pyx_XDECREF(__pyx_v_childh);
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_cw);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_XDECREF(__pyx_v_ch);
  __Pyx_XDECREF(__pyx_v_offset);
  __Pyx_XDECREF(__pyx_v_crop);
  __Pyx_XDECREF(__pyx_v_cropw);
  __Pyx_XDECREF(__pyx_v_croph);
  __Pyx_XDECREF(__pyx_v_newchild);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_fw);
  __Pyx_XDECREF(__pyx_v_fh);
  __Pyx_XDECREF(__pyx_v_mx);
  __Pyx_XDECREF(__pyx_v_my);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_mw);
  __Pyx_XDECREF(__pyx_v_mh);
  __Pyx_XDECREF(__pyx_v_mcx);
  __Pyx_XDECREF(__pyx_v_mcy);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1035
 * 
 * 
 *     def depends_on(self, source, focus=False):             # <<<<<<<<<<<<<<
 *         """
 *         Used to indicate that this render depends on another
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_21depends_on(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_20depends_on[] = "\n        Used to indicate that this render depends on another\n        render. Useful, for example, if we use pygame_surface to make\n        a surface, and then blit that surface into another render.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_21depends_on(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_focus = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("depends_on (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,&__pyx_n_s_focus,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focus);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "depends_on") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_source = values[0];
    __pyx_v_focus = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("depends_on", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.depends_on", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_20depends_on(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_source, __pyx_v_focus);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_20depends_on(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_focus) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("depends_on", 0);

  /* "renpy/display/render.pyx":1042
 *         """
 * 
 *         if source is self:             # <<<<<<<<<<<<<<
 *             raise Exception("Render depends on itself.")
 * 
 */
  __pyx_t_1 = (__pyx_v_source == ((PyObject *)__pyx_v_self));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1043
 * 
 *         if source is self:
 *             raise Exception("Render depends on itself.")             # <<<<<<<<<<<<<<
 * 
 *         self.depends_on_list.append(source)
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }

  /* "renpy/display/render.pyx":1045
 *             raise Exception("Render depends on itself.")
 * 
 *         self.depends_on_list.append(source)             # <<<<<<<<<<<<<<
 *         source.parents.add(self)
 * 
 */
  if (unlikely(__pyx_v_self->depends_on_list == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->depends_on_list, __pyx_v_source); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":1046
 * 
 *         self.depends_on_list.append(source)
 *         source.parents.add(self)             # <<<<<<<<<<<<<<
 * 
 *         if focus:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1048
 *         source.parents.add(self)
 * 
 *         if focus:             # <<<<<<<<<<<<<<
 *             if self.pass_focuses is None:
 *                 self.pass_focuses = [ source ]
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_focus); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1049
 * 
 *         if focus:
 *             if self.pass_focuses is None:             # <<<<<<<<<<<<<<
 *                 self.pass_focuses = [ source ]
 *             else:
 */
    __pyx_t_2 = (__pyx_v_self->pass_focuses == ((PyObject*)Py_None));
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":1050
 *         if focus:
 *             if self.pass_focuses is None:
 *                 self.pass_focuses = [ source ]             # <<<<<<<<<<<<<<
 *             else:
 *                 self.pass_focuses.append(source)
 */
      __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_source);
      PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_source);
      __Pyx_GIVEREF(__pyx_v_source);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->pass_focuses);
      __Pyx_DECREF(__pyx_v_self->pass_focuses);
      __pyx_v_self->pass_focuses = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":1052
 *                 self.pass_focuses = [ source ]
 *             else:
 *                 self.pass_focuses.append(source)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_self->pass_focuses == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->pass_focuses, __pyx_v_source); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":1035
 * 
 * 
 *     def depends_on(self, source, focus=False):             # <<<<<<<<<<<<<<
 *         """
 *         Used to indicate that this render depends on another
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.depends_on", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1055
 * 
 * 
 *     def kill_cache(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removes this render and its transitive parents from the cache.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_23kill_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_22kill_cache[] = "\n        Removes this render and its transitive parents from the cache.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_23kill_cache(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("kill_cache (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_22kill_cache(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_22kill_cache(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_ro = NULL;
  PyObject *__pyx_v_id_ro = NULL;
  PyObject *__pyx_v_cache = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *(*__pyx_t_12)(PyObject *);
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("kill_cache", 0);

  /* "renpy/display/render.pyx":1060
 *         """
 * 
 *         if self.cache_killed:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (__pyx_v_self->cache_killed != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1061
 * 
 *         if self.cache_killed:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         self.cache_killed = True
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1063
 *             return
 * 
 *         self.cache_killed = True             # <<<<<<<<<<<<<<
 * 
 *         for i in self.parents:
 */
  __pyx_v_self->cache_killed = 1;

  /* "renpy/display/render.pyx":1065
 *         self.cache_killed = True
 * 
 *         for i in self.parents:             # <<<<<<<<<<<<<<
 *             i.kill_cache()
 * 
 */
  __pyx_t_2 = PyObject_GetIter(__pyx_v_self->parents); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  for (;;) {
    {
      __pyx_t_4 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1066
 * 
 *         for i in self.parents:
 *             i.kill_cache()             # <<<<<<<<<<<<<<
 * 
 *         self.parents.clear()
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_kill_cache); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1065
 *         self.cache_killed = True
 * 
 *         for i in self.parents:             # <<<<<<<<<<<<<<
 *             i.kill_cache()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":1068
 *             i.kill_cache()
 * 
 *         self.parents.clear()             # <<<<<<<<<<<<<<
 * 
 *         for i in self.depends_on_list:
 */
  if (unlikely(__pyx_v_self->parents == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "clear");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_7 = PySet_Clear(__pyx_v_self->parents); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":1070
 *         self.parents.clear()
 * 
 *         for i in self.depends_on_list:             # <<<<<<<<<<<<<<
 *             if not i.cache_killed:
 *                 i.parents.discard(self)
 */
  if (unlikely(__pyx_v_self->depends_on_list == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_2 = __pyx_v_self->depends_on_list; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
  for (;;) {
    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1071
 * 
 *         for i in self.depends_on_list:
 *             if not i.cache_killed:             # <<<<<<<<<<<<<<
 *                 i.parents.discard(self)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_cache_killed); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_9 = ((!__pyx_t_1) != 0);
    if (__pyx_t_9) {

      /* "renpy/display/render.pyx":1072
 *         for i in self.depends_on_list:
 *             if not i.cache_killed:
 *                 i.parents.discard(self)             # <<<<<<<<<<<<<<
 * 
 *         for ro in self.render_of:
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_parents); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_discard); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
      } else {
        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(((PyObject *)__pyx_v_self));
        PyTuple_SET_ITEM(__pyx_t_10, 0+1, ((PyObject *)__pyx_v_self));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "renpy/display/render.pyx":1070
 *         self.parents.clear()
 * 
 *         for i in self.depends_on_list:             # <<<<<<<<<<<<<<
 *             if not i.cache_killed:
 *                 i.parents.discard(self)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":1074
 *                 i.parents.discard(self)
 * 
 *         for ro in self.render_of:             # <<<<<<<<<<<<<<
 *             id_ro = id(ro)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_self->render_of)) || PyTuple_CheckExact(__pyx_v_self->render_of)) {
    __pyx_t_2 = __pyx_v_self->render_of; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->render_of); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_2);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_ro, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1075
 * 
 *         for ro in self.render_of:
 *             id_ro = id(ro)             # <<<<<<<<<<<<<<
 * 
 *             cache = render_cache[id_ro]
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_ro);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ro);
    __Pyx_GIVEREF(__pyx_v_ro);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_id_ro, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "renpy/display/render.pyx":1077
 *             id_ro = id(ro)
 * 
 *             cache = render_cache[id_ro]             # <<<<<<<<<<<<<<
 *             for k, v in cache.items():
 *                 if v is self:
 */
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = PyObject_GetItem(__pyx_t_6, __pyx_v_id_ro); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cache, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1078
 * 
 *             cache = render_cache[id_ro]
 *             for k, v in cache.items():             # <<<<<<<<<<<<<<
 *                 if v is self:
 *                     del cache[k]
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cache, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_10) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    } else {
      __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
      __pyx_t_12 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_12)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_12(__pyx_t_6);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_5);
        #else
        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_10 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_5)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L14_unpacking_done;
        __pyx_L13_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L14_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1079
 *             cache = render_cache[id_ro]
 *             for k, v in cache.items():
 *                 if v is self:             # <<<<<<<<<<<<<<
 *                     del cache[k]
 * 
 */
      __pyx_t_9 = (__pyx_v_v == ((PyObject *)__pyx_v_self));
      __pyx_t_1 = (__pyx_t_9 != 0);
      if (__pyx_t_1) {

        /* "renpy/display/render.pyx":1080
 *             for k, v in cache.items():
 *                 if v is self:
 *                     del cache[k]             # <<<<<<<<<<<<<<
 * 
 *             if not cache:
 */
        if (PyObject_DelItem(__pyx_v_cache, __pyx_v_k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L15;
      }
      __pyx_L15:;

      /* "renpy/display/render.pyx":1078
 * 
 *             cache = render_cache[id_ro]
 *             for k, v in cache.items():             # <<<<<<<<<<<<<<
 *                 if v is self:
 *                     del cache[k]
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "renpy/display/render.pyx":1082
 *                     del cache[k]
 * 
 *             if not cache:             # <<<<<<<<<<<<<<
 *                 del render_cache[id_ro]
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_cache); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = ((!__pyx_t_1) != 0);
    if (__pyx_t_9) {

      /* "renpy/display/render.pyx":1083
 * 
 *             if not cache:
 *                 del render_cache[id_ro]             # <<<<<<<<<<<<<<
 * 
 *         self.render_of = None
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_cache); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (PyObject_DelItem(__pyx_t_6, __pyx_v_id_ro) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "renpy/display/render.pyx":1074
 *                 i.parents.discard(self)
 * 
 *         for ro in self.render_of:             # <<<<<<<<<<<<<<
 *             id_ro = id(ro)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":1085
 *                 del render_cache[id_ro]
 * 
 *         self.render_of = None             # <<<<<<<<<<<<<<
 *         self.focuses = None
 *         self.pass_focuses = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->render_of);
  __Pyx_DECREF(__pyx_v_self->render_of);
  __pyx_v_self->render_of = Py_None;

  /* "renpy/display/render.pyx":1086
 * 
 *         self.render_of = None
 *         self.focuses = None             # <<<<<<<<<<<<<<
 *         self.pass_focuses = None
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->focuses);
  __Pyx_DECREF(__pyx_v_self->focuses);
  __pyx_v_self->focuses = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":1087
 *         self.render_of = None
 *         self.focuses = None
 *         self.pass_focuses = None             # <<<<<<<<<<<<<<
 * 
 *     def kill(self):
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->pass_focuses);
  __Pyx_DECREF(__pyx_v_self->pass_focuses);
  __pyx_v_self->pass_focuses = ((PyObject*)Py_None);

  /* "renpy/display/render.pyx":1055
 * 
 * 
 *     def kill_cache(self):             # <<<<<<<<<<<<<<
 *         """
 *         Removes this render and its transitive parents from the cache.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("renpy.display.render.Render.kill_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_ro);
  __Pyx_XDECREF(__pyx_v_id_ro);
  __Pyx_XDECREF(__pyx_v_cache);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1089
 *         self.pass_focuses = None
 * 
 *     def kill(self):             # <<<<<<<<<<<<<<
 *         """
 *         Retained for compatibility, but does not need to be called.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_25kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_24kill[] = "\n        Retained for compatibility, but does not need to be called.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_25kill(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("kill (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_24kill(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_24kill(CYTHON_UNUSED struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("kill", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1094
 *         """
 * 
 *     def add_focus(self, d, arg=None, x=0, y=0, w=None, h=None, mx=None, my=None, mask=None):             # <<<<<<<<<<<<<<
 *         """
 *         This is called to indicate a region of the screen that can be
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_27add_focus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_26add_focus[] = "\n        This is called to indicate a region of the screen that can be\n        focused.\n\n        `d` - the displayable that is being focused.\n        `arg` - an argument.\n\n        The rest of the parameters are a rectangle giving the portion of\n        this region corresponding to the focus. If they are all None, than\n        this focus is assumed to be the singular full-screen focus.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_27add_focus(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_arg = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_w = 0;
  PyObject *__pyx_v_h = 0;
  PyObject *__pyx_v_mx = 0;
  PyObject *__pyx_v_my = 0;
  PyObject *__pyx_v_mask = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_focus (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_arg,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_mx,&__pyx_n_s_my,&__pyx_n_s_mask,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)__pyx_int_0);
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)Py_None);
    values[8] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_h);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mx);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_my);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_focus") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_d = values[0];
    __pyx_v_arg = values[1];
    __pyx_v_x = values[2];
    __pyx_v_y = values[3];
    __pyx_v_w = values[4];
    __pyx_v_h = values[5];
    __pyx_v_mx = values[6];
    __pyx_v_my = values[7];
    __pyx_v_mask = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_focus", 0, 1, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.add_focus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_26add_focus(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_d, __pyx_v_arg, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_h, __pyx_v_mx, __pyx_v_my, __pyx_v_mask);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_26add_focus(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_d, PyObject *__pyx_v_arg, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_mx, PyObject *__pyx_v_my, PyObject *__pyx_v_mask) {
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_focus", 0);

  /* "renpy/display/render.pyx":1107
 *         """
 * 
 *         if isinstance(mask, Render) and mask is not self:             # <<<<<<<<<<<<<<
 *             self.depends_on(mask)
 * 
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_mask, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = (__pyx_v_mask != ((PyObject *)__pyx_v_self));
  __pyx_t_2 = (__pyx_t_3 != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1108
 * 
 *         if isinstance(mask, Render) and mask is not self:
 *             self.depends_on(mask)             # <<<<<<<<<<<<<<
 * 
 *         t = (d, arg, x, y, w, h, mx, my, mask)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_depends_on); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_mask); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_mask);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_mask);
      __Pyx_GIVEREF(__pyx_v_mask);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1110
 *             self.depends_on(mask)
 * 
 *         t = (d, arg, x, y, w, h, mx, my, mask)             # <<<<<<<<<<<<<<
 * 
 *         if self.focuses is None:
 */
  __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_d);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_d);
  __Pyx_GIVEREF(__pyx_v_d);
  __Pyx_INCREF(__pyx_v_arg);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_arg);
  __Pyx_GIVEREF(__pyx_v_arg);
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_w);
  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_w);
  __Pyx_GIVEREF(__pyx_v_w);
  __Pyx_INCREF(__pyx_v_h);
  PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_h);
  __Pyx_GIVEREF(__pyx_v_h);
  __Pyx_INCREF(__pyx_v_mx);
  PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_v_mx);
  __Pyx_GIVEREF(__pyx_v_mx);
  __Pyx_INCREF(__pyx_v_my);
  PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_v_my);
  __Pyx_GIVEREF(__pyx_v_my);
  __Pyx_INCREF(__pyx_v_mask);
  PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_v_mask);
  __Pyx_GIVEREF(__pyx_v_mask);
  __pyx_v_t = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":1112
 *         t = (d, arg, x, y, w, h, mx, my, mask)
 * 
 *         if self.focuses is None:             # <<<<<<<<<<<<<<
 *             self.focuses = [ t ]
 *         else:
 */
  __pyx_t_1 = (__pyx_v_self->focuses == ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1113
 * 
 *         if self.focuses is None:
 *             self.focuses = [ t ]             # <<<<<<<<<<<<<<
 *         else:
 *             self.focuses.append(t)
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_t);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_t);
    __Pyx_GIVEREF(__pyx_v_t);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->focuses);
    __Pyx_DECREF(__pyx_v_self->focuses);
    __pyx_v_self->focuses = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":1115
 *             self.focuses = [ t ]
 *         else:
 *             self.focuses.append(t)             # <<<<<<<<<<<<<<
 * 
 *     def take_focuses(self, cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses): #@DuplicatedSignature
 */
    if (unlikely(__pyx_v_self->focuses == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->focuses, __pyx_v_t); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  /* "renpy/display/render.pyx":1094
 *         """
 * 
 *     def add_focus(self, d, arg=None, x=0, y=0, w=None, h=None, mx=None, my=None, mask=None):             # <<<<<<<<<<<<<<
 *         """
 *         This is called to indicate a region of the screen that can be
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.add_focus", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1117
 *             self.focuses.append(t)
 * 
 *     def take_focuses(self, cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         This adds to focuses Focus objects corresponding to the focuses
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_29take_focuses(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_28take_focuses[] = "\n        This adds to focuses Focus objects corresponding to the focuses\n        added to this object and its children, transformed into screen\n        coordinates.\n\n        `cminx`, `cminy`, `cmaxx`, `cmaxy`\n            The clipping rectangle.\n\n        `reverse`\n            The transform from render to screen coordinates.\n\n        `x`, `y`\n            The offset of the upper-left corner of the render.\n\n        `screen`\n            The screen this is a render of, or None if this is not part of\n            a screen.\n\n        `focuses`\n            The list of focuses to add to.\n\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_29take_focuses(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cminx = 0;
  PyObject *__pyx_v_cminy = 0;
  PyObject *__pyx_v_cmaxx = 0;
  PyObject *__pyx_v_cmaxy = 0;
  PyObject *__pyx_v_reverse = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_screen = 0;
  PyObject *__pyx_v_focuses = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("take_focuses (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cminx,&__pyx_n_s_cminy,&__pyx_n_s_cmaxx,&__pyx_n_s_cmaxy,&__pyx_n_s_reverse,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_screen,&__pyx_n_s_focuses,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cminx)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cminy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cmaxx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cmaxy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_reverse)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  6:
        if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  7:
        if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_screen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  8:
        if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_focuses)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_focuses") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
      values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
    }
    __pyx_v_cminx = values[0];
    __pyx_v_cminy = values[1];
    __pyx_v_cmaxx = values[2];
    __pyx_v_cmaxy = values[3];
    __pyx_v_reverse = values[4];
    __pyx_v_x = values[5];
    __pyx_v_y = values[6];
    __pyx_v_screen = values[7];
    __pyx_v_focuses = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("take_focuses", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.take_focuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_28take_focuses(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_cminx, __pyx_v_cminy, __pyx_v_cmaxx, __pyx_v_cmaxy, __pyx_v_reverse, __pyx_v_x, __pyx_v_y, __pyx_v_screen, __pyx_v_focuses);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_28take_focuses(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_cminx, PyObject *__pyx_v_cminy, PyObject *__pyx_v_cmaxx, PyObject *__pyx_v_cmaxy, PyObject *__pyx_v_reverse, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_screen, PyObject *__pyx_v_focuses) {
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_mx = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_my = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v_x1 = NULL;
  PyObject *__pyx_v_y1 = NULL;
  PyObject *__pyx_v_x2 = NULL;
  PyObject *__pyx_v_y2 = NULL;
  PyObject *__pyx_v_minx = NULL;
  PyObject *__pyx_v_miny = NULL;
  PyObject *__pyx_v_maxx = NULL;
  PyObject *__pyx_v_maxy = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_focus = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_main = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  int __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("take_focuses", 0);
  __Pyx_INCREF(__pyx_v_cminx);
  __Pyx_INCREF(__pyx_v_cminy);
  __Pyx_INCREF(__pyx_v_cmaxx);
  __Pyx_INCREF(__pyx_v_cmaxy);
  __Pyx_INCREF(__pyx_v_reverse);
  __Pyx_INCREF(__pyx_v_screen);

  /* "renpy/display/render.pyx":1141
 *         """
 * 
 *         if self.focus_screen is not None:             # <<<<<<<<<<<<<<
 *             screen = self.focus_screen
 * 
 */
  __pyx_t_1 = (__pyx_v_self->focus_screen != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1142
 * 
 *         if self.focus_screen is not None:
 *             screen = self.focus_screen             # <<<<<<<<<<<<<<
 * 
 *         if self.modal:
 */
    __pyx_t_3 = __pyx_v_self->focus_screen;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_screen, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1144
 *             screen = self.focus_screen
 * 
 *         if self.modal:             # <<<<<<<<<<<<<<
 *             focuses[:] = [ ]
 * 
 */
  __pyx_t_2 = (__pyx_v_self->modal != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1145
 * 
 *         if self.modal:
 *             focuses[:] = [ ]             # <<<<<<<<<<<<<<
 * 
 *         if self.reverse:
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_PyObject_SetSlice(__pyx_v_focuses, __pyx_t_3, 0, 0, NULL, NULL, &__pyx_slice__9, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":1147
 *             focuses[:] = [ ]
 * 
 *         if self.reverse:             # <<<<<<<<<<<<<<
 *             reverse = reverse * self.reverse
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->reverse)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1148
 * 
 *         if self.reverse:
 *             reverse = reverse * self.reverse             # <<<<<<<<<<<<<<
 * 
 *         if self.focuses:
 */
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_reverse, ((PyObject *)__pyx_v_self->reverse)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_reverse, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "renpy/display/render.pyx":1150
 *             reverse = reverse * self.reverse
 * 
 *         if self.focuses:             # <<<<<<<<<<<<<<
 * 
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:
 */
  __pyx_t_2 = (__pyx_v_self->focuses != Py_None) && (PyList_GET_SIZE(__pyx_v_self->focuses) != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1152
 *         if self.focuses:
 * 
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
    if (unlikely(__pyx_v_self->focuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __pyx_v_self->focuses; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 9)) {
          if (size > 9) __Pyx_RaiseTooManyValuesError(9);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 5); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 6); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 7); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 8); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 4); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 5); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 6); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 7); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 8); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_14);
        #else
        {
          Py_ssize_t i;
          PyObject** temps[9] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
          for (i=0; i < 9; i++) {
            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
        }
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        PyObject** temps[9] = {&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
        __pyx_t_15 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
        for (index=0; index < 9; index++) {
          PyObject* item = __pyx_t_16(__pyx_t_15); if (unlikely(!item)) goto __pyx_L9_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L10_unpacking_done;
        __pyx_L9_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L10_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mx, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_my, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "renpy/display/render.pyx":1154
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:
 * 
 *                 if xo is None:             # <<<<<<<<<<<<<<
 *                     focuses.append(renpy.display.focus.Focus(d, arg, None, None, None, None, screen))
 *                     continue
 */
      __pyx_t_2 = (__pyx_v_xo == Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "renpy/display/render.pyx":1155
 * 
 *                 if xo is None:
 *                     focuses.append(renpy.display.focus.Focus(d, arg, None, None, None, None, screen))             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
        __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_display); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_focus); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_Focus); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_14 = NULL;
        __pyx_t_17 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_13, function);
            __pyx_t_17 = 1;
          }
        }
        __pyx_t_12 = PyTuple_New(7+__pyx_t_17); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (__pyx_t_14) {
          PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
        }
        __Pyx_INCREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_17, __pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        __Pyx_INCREF(__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_17, __pyx_v_arg);
        __Pyx_GIVEREF(__pyx_v_arg);
        __Pyx_INCREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_17, Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_INCREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_17, Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_INCREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_12, 4+__pyx_t_17, Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_INCREF(Py_None);
        PyTuple_SET_ITEM(__pyx_t_12, 5+__pyx_t_17, Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_INCREF(__pyx_v_screen);
        PyTuple_SET_ITEM(__pyx_t_12, 6+__pyx_t_17, __pyx_v_screen);
        __Pyx_GIVEREF(__pyx_v_screen);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_18 = __Pyx_PyObject_Append(__pyx_v_focuses, __pyx_t_5); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "renpy/display/render.pyx":1156
 *                 if xo is None:
 *                     focuses.append(renpy.display.focus.Focus(d, arg, None, None, None, None, screen))
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 x1, y1 = reverse.transform(xo, yo)
 */
        goto __pyx_L7_continue;
      }

      /* "renpy/display/render.pyx":1158
 *                     continue
 * 
 *                 x1, y1 = reverse.transform(xo, yo)             # <<<<<<<<<<<<<<
 *                 x2, y2 = reverse.transform(xo + w, yo + h)
 * 
 */
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse, __pyx_n_s_transform); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_14 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      if (__pyx_t_12) {
        PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
      }
      __Pyx_INCREF(__pyx_v_xo);
      PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_17, __pyx_v_xo);
      __Pyx_GIVEREF(__pyx_v_xo);
      __Pyx_INCREF(__pyx_v_yo);
      PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_17, __pyx_v_yo);
      __Pyx_GIVEREF(__pyx_v_yo);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_14);
        #else
        __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_13)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        index = 1; __pyx_t_14 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_14)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_14);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L13_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_x1, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y1, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "renpy/display/render.pyx":1159
 * 
 *                 x1, y1 = reverse.transform(xo, yo)
 *                 x2, y2 = reverse.transform(xo + w, yo + h)             # <<<<<<<<<<<<<<
 * 
 *                 minx = min(x1, x2) + x
 */
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse, __pyx_n_s_transform); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_13 = PyNumber_Add(__pyx_v_xo, __pyx_v_w); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = PyNumber_Add(__pyx_v_yo, __pyx_v_h); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_11) {
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
      }
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_17, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_17, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_13 = 0;
      __pyx_t_12 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_14);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_12)->tp_iternext;
        index = 0; __pyx_t_14 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_14)) goto __pyx_L14_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_14);
        index = 1; __pyx_t_10 = __pyx_t_16(__pyx_t_12); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_12), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        goto __pyx_L15_unpacking_done;
        __pyx_L14_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L15_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_x2, __pyx_t_14);
      __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y2, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "renpy/display/render.pyx":1161
 *                 x2, y2 = reverse.transform(xo + w, yo + h)
 * 
 *                 minx = min(x1, x2) + x             # <<<<<<<<<<<<<<
 *                 miny = min(y1, y2) + y
 *                 maxx = max(x1, x2) + x
 */
      __Pyx_INCREF(__pyx_v_x2);
      __pyx_t_5 = __pyx_v_x2;
      __Pyx_INCREF(__pyx_v_x1);
      __pyx_t_10 = __pyx_v_x1;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_14 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_14 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_14, __pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_minx, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1162
 * 
 *                 minx = min(x1, x2) + x
 *                 miny = min(y1, y2) + y             # <<<<<<<<<<<<<<
 *                 maxx = max(x1, x2) + x
 *                 maxy = max(y1, y2) + y
 */
      __Pyx_INCREF(__pyx_v_y2);
      __pyx_t_5 = __pyx_v_y2;
      __Pyx_INCREF(__pyx_v_y1);
      __pyx_t_14 = __pyx_v_y1;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_10 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_10 = __pyx_t_14;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_v_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_miny, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1163
 *                 minx = min(x1, x2) + x
 *                 miny = min(y1, y2) + y
 *                 maxx = max(x1, x2) + x             # <<<<<<<<<<<<<<
 *                 maxy = max(y1, y2) + y
 * 
 */
      __Pyx_INCREF(__pyx_v_x2);
      __pyx_t_5 = __pyx_v_x2;
      __Pyx_INCREF(__pyx_v_x1);
      __pyx_t_10 = __pyx_v_x1;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_14 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_14 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_14, __pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF_SET(__pyx_v_maxx, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1164
 *                 miny = min(y1, y2) + y
 *                 maxx = max(x1, x2) + x
 *                 maxy = max(y1, y2) + y             # <<<<<<<<<<<<<<
 * 
 *                 minx = max(minx, cminx)
 */
      __Pyx_INCREF(__pyx_v_y2);
      __pyx_t_5 = __pyx_v_y2;
      __Pyx_INCREF(__pyx_v_y1);
      __pyx_t_14 = __pyx_v_y1;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_10 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_10 = __pyx_t_14;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_v_y); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_maxy, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1166
 *                 maxy = max(y1, y2) + y
 * 
 *                 minx = max(minx, cminx)             # <<<<<<<<<<<<<<
 *                 miny = max(miny, cminy)
 *                 maxx = min(maxx, cmaxx)
 */
      __Pyx_INCREF(__pyx_v_cminx);
      __pyx_t_5 = __pyx_v_cminx;
      __Pyx_INCREF(__pyx_v_minx);
      __pyx_t_10 = __pyx_v_minx;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_14 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_14 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_14;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF_SET(__pyx_v_minx, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1167
 * 
 *                 minx = max(minx, cminx)
 *                 miny = max(miny, cminy)             # <<<<<<<<<<<<<<
 *                 maxx = min(maxx, cmaxx)
 *                 maxy = min(maxy, cmaxy)
 */
      __Pyx_INCREF(__pyx_v_cminy);
      __pyx_t_5 = __pyx_v_cminy;
      __Pyx_INCREF(__pyx_v_miny);
      __pyx_t_14 = __pyx_v_miny;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_GT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_10 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_10 = __pyx_t_14;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_10;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_miny, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1168
 *                 minx = max(minx, cminx)
 *                 miny = max(miny, cminy)
 *                 maxx = min(maxx, cmaxx)             # <<<<<<<<<<<<<<
 *                 maxy = min(maxy, cmaxy)
 * 
 */
      __Pyx_INCREF(__pyx_v_cmaxx);
      __pyx_t_5 = __pyx_v_cmaxx;
      __Pyx_INCREF(__pyx_v_maxx);
      __pyx_t_10 = __pyx_v_maxx;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_14 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_10);
        __pyx_t_14 = __pyx_t_10;
      }
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_14;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF_SET(__pyx_v_maxx, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1169
 *                 miny = max(miny, cminy)
 *                 maxx = min(maxx, cmaxx)
 *                 maxy = min(maxy, cmaxy)             # <<<<<<<<<<<<<<
 * 
 *                 if minx >= maxx or miny >= maxy:
 */
      __Pyx_INCREF(__pyx_v_cmaxy);
      __pyx_t_5 = __pyx_v_cmaxy;
      __Pyx_INCREF(__pyx_v_maxy);
      __pyx_t_14 = __pyx_v_maxy;
      __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (__pyx_t_1) {
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_10 = __pyx_t_5;
      } else {
        __Pyx_INCREF(__pyx_t_14);
        __pyx_t_10 = __pyx_t_14;
      }
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __pyx_t_10;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_maxy, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1171
 *                 maxy = min(maxy, cmaxy)
 * 
 *                 if minx >= maxx or miny >= maxy:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_minx, __pyx_v_maxx, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L17_bool_binop_done;
      }
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_miny, __pyx_v_maxy, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_1 = __pyx_t_2;
      __pyx_L17_bool_binop_done:;
      if (__pyx_t_1) {

        /* "renpy/display/render.pyx":1172
 * 
 *                 if minx >= maxx or miny >= maxy:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 focuses.append(renpy.display.focus.Focus(d, arg, minx, miny, maxx - minx, maxy - miny, screen))
 */
        goto __pyx_L7_continue;
      }

      /* "renpy/display/render.pyx":1174
 *                     continue
 * 
 *                 focuses.append(renpy.display.focus.Focus(d, arg, minx, miny, maxx - minx, maxy - miny, screen))             # <<<<<<<<<<<<<<
 * 
 *         if self.xclipping:
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_display); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_focus); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Focus); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Subtract(__pyx_v_maxx, __pyx_v_minx); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = PyNumber_Subtract(__pyx_v_maxy, __pyx_v_miny); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_14, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_11 = PyTuple_New(7+__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_13) {
        PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
      }
      __Pyx_INCREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_17, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      __Pyx_INCREF(__pyx_v_arg);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_17, __pyx_v_arg);
      __Pyx_GIVEREF(__pyx_v_arg);
      __Pyx_INCREF(__pyx_v_minx);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_17, __pyx_v_minx);
      __Pyx_GIVEREF(__pyx_v_minx);
      __Pyx_INCREF(__pyx_v_miny);
      PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_17, __pyx_v_miny);
      __Pyx_GIVEREF(__pyx_v_miny);
      PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_17, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_11, 5+__pyx_t_17, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_v_screen);
      PyTuple_SET_ITEM(__pyx_t_11, 6+__pyx_t_17, __pyx_v_screen);
      __Pyx_GIVEREF(__pyx_v_screen);
      __pyx_t_10 = 0;
      __pyx_t_12 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_18 = __Pyx_PyObject_Append(__pyx_v_focuses, __pyx_t_5); if (unlikely(__pyx_t_18 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1152
 *         if self.focuses:
 * 
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
      __pyx_L7_continue:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "renpy/display/render.pyx":1176
 *                 focuses.append(renpy.display.focus.Focus(d, arg, minx, miny, maxx - minx, maxy - miny, screen))
 * 
 *         if self.xclipping:             # <<<<<<<<<<<<<<
 *             cminx = max(cminx, x)
 *             cmaxx = min(cmaxx, x + self.width)
 */
  __pyx_t_1 = (__pyx_v_self->xclipping != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1177
 * 
 *         if self.xclipping:
 *             cminx = max(cminx, x)             # <<<<<<<<<<<<<<
 *             cmaxx = min(cmaxx, x + self.width)
 * 
 */
    __Pyx_INCREF(__pyx_v_x);
    __pyx_t_3 = __pyx_v_x;
    __Pyx_INCREF(__pyx_v_cminx);
    __pyx_t_5 = __pyx_v_cminx;
    __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_14 = __pyx_t_3;
    } else {
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_14 = __pyx_t_5;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_t_14;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF_SET(__pyx_v_cminx, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":1178
 *         if self.xclipping:
 *             cminx = max(cminx, x)
 *             cmaxx = min(cmaxx, x + self.width)             # <<<<<<<<<<<<<<
 * 
 *         if self.yclipping:
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_14 = PyNumber_Add(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_v_cmaxx);
    __pyx_t_3 = __pyx_v_cmaxx;
    __pyx_t_11 = PyObject_RichCompare(__pyx_t_14, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_5 = __pyx_t_14;
    } else {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = __pyx_t_3;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_cmaxx, __pyx_t_14);
    __pyx_t_14 = 0;
    goto __pyx_L19;
  }
  __pyx_L19:;

  /* "renpy/display/render.pyx":1180
 *             cmaxx = min(cmaxx, x + self.width)
 * 
 *         if self.yclipping:             # <<<<<<<<<<<<<<
 *             cminy = max(cminy, y)
 *             cmaxy = min(cmaxx, x + self.height)
 */
  __pyx_t_1 = (__pyx_v_self->yclipping != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1181
 * 
 *         if self.yclipping:
 *             cminy = max(cminy, y)             # <<<<<<<<<<<<<<
 *             cmaxy = min(cmaxx, x + self.height)
 * 
 */
    __Pyx_INCREF(__pyx_v_y);
    __pyx_t_14 = __pyx_v_y;
    __Pyx_INCREF(__pyx_v_cminy);
    __pyx_t_5 = __pyx_v_cminy;
    __pyx_t_11 = PyObject_RichCompare(__pyx_t_14, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_3 = __pyx_t_14;
    } else {
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_3 = __pyx_t_5;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __pyx_t_14 = __pyx_t_3;
    __Pyx_INCREF(__pyx_t_14);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_cminy, __pyx_t_14);
    __pyx_t_14 = 0;

    /* "renpy/display/render.pyx":1182
 *         if self.yclipping:
 *             cminy = max(cminy, y)
 *             cmaxy = min(cmaxx, x + self.height)             # <<<<<<<<<<<<<<
 * 
 *         for child, xo, yo, focus, main in self.children:
 */
    __pyx_t_14 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    __pyx_t_3 = PyNumber_Add(__pyx_v_x, __pyx_t_14); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_INCREF(__pyx_v_cmaxx);
    __pyx_t_14 = __pyx_v_cmaxx;
    __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_14, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_1) {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_5 = __pyx_t_3;
    } else {
      __Pyx_INCREF(__pyx_t_14);
      __pyx_t_5 = __pyx_t_14;
    }
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __pyx_t_5;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_cmaxy, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L20;
  }
  __pyx_L20:;

  /* "renpy/display/render.pyx":1184
 *             cmaxy = min(cmaxx, x + self.height)
 * 
 *         for child, xo, yo, focus, main in self.children:             # <<<<<<<<<<<<<<
 *             if not focus or not isinstance(child, Render):
 *                 continue
 */
  if (unlikely(__pyx_v_self->children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_3 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_13 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_13);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_11,&__pyx_t_12,&__pyx_t_10,&__pyx_t_13};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_14,&__pyx_t_11,&__pyx_t_12,&__pyx_t_10,&__pyx_t_13};
      __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_16(__pyx_t_9); if (unlikely(!item)) goto __pyx_L23_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_9), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L24_unpacking_done;
      __pyx_L23_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_16 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L24_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_12);
    __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_13);
    __pyx_t_13 = 0;

    /* "renpy/display/render.pyx":1185
 * 
 *         for child, xo, yo, focus, main in self.children:
 *             if not focus or not isinstance(child, Render):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_focus); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_19 = ((!__pyx_t_2) != 0);
    if (!__pyx_t_19) {
    } else {
      __pyx_t_1 = __pyx_t_19;
      goto __pyx_L26_bool_binop_done;
    }
    __pyx_t_19 = __Pyx_TypeCheck(__pyx_v_child, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
    __pyx_t_2 = ((!(__pyx_t_19 != 0)) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L26_bool_binop_done:;
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":1186
 *         for child, xo, yo, focus, main in self.children:
 *             if not focus or not isinstance(child, Render):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             xo, yo = reverse.transform(xo, yo)
 */
      goto __pyx_L21_continue;
    }

    /* "renpy/display/render.pyx":1188
 *                 continue
 * 
 *             xo, yo = reverse.transform(xo, yo)             # <<<<<<<<<<<<<<
 *             child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x + xo, y + yo, screen, focuses)
 * 
 */
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_reverse, __pyx_n_s_transform); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_10 = NULL;
    __pyx_t_17 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_17 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_10) {
      PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_INCREF(__pyx_v_xo);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_17, __pyx_v_xo);
    __Pyx_GIVEREF(__pyx_v_xo);
    __Pyx_INCREF(__pyx_v_yo);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_17, __pyx_v_yo);
    __Pyx_GIVEREF(__pyx_v_yo);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_13 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_12);
      #else
      __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_16 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_13 = __pyx_t_16(__pyx_t_10); if (unlikely(!__pyx_t_13)) goto __pyx_L28_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_13);
      index = 1; __pyx_t_12 = __pyx_t_16(__pyx_t_10); if (unlikely(!__pyx_t_12)) goto __pyx_L28_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_12);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L29_unpacking_done;
      __pyx_L28_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_16 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L29_unpacking_done:;
    }
    __Pyx_DECREF_SET(__pyx_v_xo, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_DECREF_SET(__pyx_v_yo, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "renpy/display/render.pyx":1189
 * 
 *             xo, yo = reverse.transform(xo, yo)
 *             child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x + xo, y + yo, screen, focuses)             # <<<<<<<<<<<<<<
 * 
 *         if self.pass_focuses:
 */
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_take_focuses); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_13 = PyNumber_Add(__pyx_v_x, __pyx_v_xo); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_10 = PyNumber_Add(__pyx_v_y, __pyx_v_yo); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = NULL;
    __pyx_t_17 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_12, function);
        __pyx_t_17 = 1;
      }
    }
    __pyx_t_14 = PyTuple_New(9+__pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_14);
    if (__pyx_t_11) {
      PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
    }
    __Pyx_INCREF(__pyx_v_cminx);
    PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_17, __pyx_v_cminx);
    __Pyx_GIVEREF(__pyx_v_cminx);
    __Pyx_INCREF(__pyx_v_cminy);
    PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_17, __pyx_v_cminy);
    __Pyx_GIVEREF(__pyx_v_cminy);
    __Pyx_INCREF(__pyx_v_cmaxx);
    PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_17, __pyx_v_cmaxx);
    __Pyx_GIVEREF(__pyx_v_cmaxx);
    __Pyx_INCREF(__pyx_v_cmaxy);
    PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_17, __pyx_v_cmaxy);
    __Pyx_GIVEREF(__pyx_v_cmaxy);
    __Pyx_INCREF(__pyx_v_reverse);
    PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_17, __pyx_v_reverse);
    __Pyx_GIVEREF(__pyx_v_reverse);
    PyTuple_SET_ITEM(__pyx_t_14, 5+__pyx_t_17, __pyx_t_13);
    __Pyx_GIVEREF(__pyx_t_13);
    PyTuple_SET_ITEM(__pyx_t_14, 6+__pyx_t_17, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_v_screen);
    PyTuple_SET_ITEM(__pyx_t_14, 7+__pyx_t_17, __pyx_v_screen);
    __Pyx_GIVEREF(__pyx_v_screen);
    __Pyx_INCREF(__pyx_v_focuses);
    PyTuple_SET_ITEM(__pyx_t_14, 8+__pyx_t_17, __pyx_v_focuses);
    __Pyx_GIVEREF(__pyx_v_focuses);
    __pyx_t_13 = 0;
    __pyx_t_10 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1184
 *             cmaxy = min(cmaxx, x + self.height)
 * 
 *         for child, xo, yo, focus, main in self.children:             # <<<<<<<<<<<<<<
 *             if not focus or not isinstance(child, Render):
 *                 continue
 */
    __pyx_L21_continue:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1191
 *             child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x + xo, y + yo, screen, focuses)
 * 
 *         if self.pass_focuses:             # <<<<<<<<<<<<<<
 *             for child in self.pass_focuses:
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)
 */
  __pyx_t_1 = (__pyx_v_self->pass_focuses != Py_None) && (PyList_GET_SIZE(__pyx_v_self->pass_focuses) != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1192
 * 
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:             # <<<<<<<<<<<<<<
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)
 * 
 */
    if (unlikely(__pyx_v_self->pass_focuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_3 = __pyx_v_self->pass_focuses; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    for (;;) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1193
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)             # <<<<<<<<<<<<<<
 * 
 *     def focus_at_point(self, x, y, screen): #@DuplicatedSignature
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_take_focuses); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_14 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_14)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_14);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(9+__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_14) {
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cminx);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_17, __pyx_v_cminx);
      __Pyx_GIVEREF(__pyx_v_cminx);
      __Pyx_INCREF(__pyx_v_cminy);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_17, __pyx_v_cminy);
      __Pyx_GIVEREF(__pyx_v_cminy);
      __Pyx_INCREF(__pyx_v_cmaxx);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_17, __pyx_v_cmaxx);
      __Pyx_GIVEREF(__pyx_v_cmaxx);
      __Pyx_INCREF(__pyx_v_cmaxy);
      PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_17, __pyx_v_cmaxy);
      __Pyx_GIVEREF(__pyx_v_cmaxy);
      __Pyx_INCREF(__pyx_v_reverse);
      PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_17, __pyx_v_reverse);
      __Pyx_GIVEREF(__pyx_v_reverse);
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_10, 5+__pyx_t_17, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __Pyx_INCREF(__pyx_v_y);
      PyTuple_SET_ITEM(__pyx_t_10, 6+__pyx_t_17, __pyx_v_y);
      __Pyx_GIVEREF(__pyx_v_y);
      __Pyx_INCREF(__pyx_v_screen);
      PyTuple_SET_ITEM(__pyx_t_10, 7+__pyx_t_17, __pyx_v_screen);
      __Pyx_GIVEREF(__pyx_v_screen);
      __Pyx_INCREF(__pyx_v_focuses);
      PyTuple_SET_ITEM(__pyx_t_10, 8+__pyx_t_17, __pyx_v_focuses);
      __Pyx_GIVEREF(__pyx_v_focuses);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "renpy/display/render.pyx":1192
 * 
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:             # <<<<<<<<<<<<<<
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L30;
  }
  __pyx_L30:;

  /* "renpy/display/render.pyx":1117
 *             self.focuses.append(t)
 * 
 *     def take_focuses(self, cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         This adds to focuses Focus objects corresponding to the focuses
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("renpy.display.render.Render.take_focuses", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_mx);
  __Pyx_XDECREF(__pyx_v_my);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_x1);
  __Pyx_XDECREF(__pyx_v_y1);
  __Pyx_XDECREF(__pyx_v_x2);
  __Pyx_XDECREF(__pyx_v_y2);
  __Pyx_XDECREF(__pyx_v_minx);
  __Pyx_XDECREF(__pyx_v_miny);
  __Pyx_XDECREF(__pyx_v_maxx);
  __Pyx_XDECREF(__pyx_v_maxy);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_cminx);
  __Pyx_XDECREF(__pyx_v_cminy);
  __Pyx_XDECREF(__pyx_v_cmaxx);
  __Pyx_XDECREF(__pyx_v_cmaxy);
  __Pyx_XDECREF(__pyx_v_reverse);
  __Pyx_XDECREF(__pyx_v_screen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1195
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)
 * 
 *     def focus_at_point(self, x, y, screen): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         This returns the focus of this object at the given point.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_31focus_at_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_30focus_at_point[] = "\n        This returns the focus of this object at the given point.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_31focus_at_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_screen = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("focus_at_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_screen,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("focus_at_point", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_screen)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("focus_at_point", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "focus_at_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_screen = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("focus_at_point", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.focus_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_30focus_at_point(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_screen);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_30focus_at_point(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_screen) {
  PyObject *__pyx_v_rv = NULL;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_v_mx = NULL;
  PyObject *__pyx_v_my = NULL;
  PyObject *__pyx_v_mask = NULL;
  PyObject *__pyx_v_cx = NULL;
  PyObject *__pyx_v_cy = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_focus = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_main = NULL;
  PyObject *__pyx_v_cf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  int __pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("focus_at_point", 0);
  __Pyx_INCREF(__pyx_v_screen);

  /* "renpy/display/render.pyx":1200
 *         """
 * 
 *         if self.focus_screen is not None:             # <<<<<<<<<<<<<<
 *             screen = self.focus_screen
 * 
 */
  __pyx_t_1 = (__pyx_v_self->focus_screen != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1201
 * 
 *         if self.focus_screen is not None:
 *             screen = self.focus_screen             # <<<<<<<<<<<<<<
 * 
 *         if self.xclipping:
 */
    __pyx_t_3 = __pyx_v_self->focus_screen;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_screen, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1203
 *             screen = self.focus_screen
 * 
 *         if self.xclipping:             # <<<<<<<<<<<<<<
 *             if x < 0 or x >= self.width:
 *                 return None
 */
  __pyx_t_2 = (__pyx_v_self->xclipping != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1204
 * 
 *         if self.xclipping:
 *             if x < 0 or x >= self.width:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L6_bool_binop_done:;
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":1205
 *         if self.xclipping:
 *             if x < 0 or x >= self.width:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         if self.yclipping:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
    }
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":1207
 *                 return None
 * 
 *         if self.yclipping:             # <<<<<<<<<<<<<<
 *             if y < 0 or y >= self.height:
 *                 return None
 */
  __pyx_t_2 = (__pyx_v_self->yclipping != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1208
 * 
 *         if self.yclipping:
 *             if y < 0 or y >= self.height:             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
    __pyx_t_4 = PyObject_RichCompare(__pyx_v_y, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!__pyx_t_1) {
    } else {
      __pyx_t_2 = __pyx_t_1;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __pyx_t_1;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":1209
 *         if self.yclipping:
 *             if y < 0 or y >= self.height:
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         if self.operation == IMAGEDISSOLVE:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
    }
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "renpy/display/render.pyx":1211
 *                 return None
 * 
 *         if self.operation == IMAGEDISSOLVE:             # <<<<<<<<<<<<<<
 *             if not self.children[0][0].is_pixel_opaque(x, y):
 *                 return None
 */
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->operation); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_IMAGEDISSOLVE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1212
 * 
 *         if self.operation == IMAGEDISSOLVE:
 *             if not self.children[0][0].is_pixel_opaque(x, y):             # <<<<<<<<<<<<<<
 *                 return None
 * 
 */
    if (unlikely(__pyx_v_self->children == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->children, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_is_pixel_opaque); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    __Pyx_INCREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = ((!__pyx_t_2) != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":1213
 *         if self.operation == IMAGEDISSOLVE:
 *             if not self.children[0][0].is_pixel_opaque(x, y):
 *                 return None             # <<<<<<<<<<<<<<
 * 
 *         rv = None
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
    }
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "renpy/display/render.pyx":1215
 *                 return None
 * 
 *         rv = None             # <<<<<<<<<<<<<<
 * 
 *         if self.focuses:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_rv = Py_None;

  /* "renpy/display/render.pyx":1217
 *         rv = None
 * 
 *         if self.focuses:             # <<<<<<<<<<<<<<
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:
 * 
 */
  __pyx_t_1 = (__pyx_v_self->focuses != Py_None) && (PyList_GET_SIZE(__pyx_v_self->focuses) != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1218
 * 
 *         if self.focuses:
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
    if (unlikely(__pyx_v_self->focuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __pyx_v_self->focuses; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 9)) {
          if (size > 9) __Pyx_RaiseTooManyValuesError(9);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
          __pyx_t_11 = PyTuple_GET_ITEM(sequence, 5); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 6); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 7); 
          __pyx_t_14 = PyTuple_GET_ITEM(sequence, 8); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 2); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 3); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 4); 
          __pyx_t_11 = PyList_GET_ITEM(sequence, 5); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 6); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 7); 
          __pyx_t_14 = PyList_GET_ITEM(sequence, 8); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_14);
        #else
        {
          Py_ssize_t i;
          PyObject** temps[9] = {&__pyx_t_7,&__pyx_t_3,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
          for (i=0; i < 9; i++) {
            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(item);
            *(temps[i]) = item;
          }
        }
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        PyObject** temps[9] = {&__pyx_t_7,&__pyx_t_3,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12,&__pyx_t_13,&__pyx_t_14};
        __pyx_t_15 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
        for (index=0; index < 9; index++) {
          PyObject* item = __pyx_t_16(__pyx_t_15); if (unlikely(!item)) goto __pyx_L17_unpacking_failed;
          __Pyx_GOTREF(item);
          *(temps[index]) = item;
        }
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_15), 9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        goto __pyx_L18_unpacking_done;
        __pyx_L17_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L18_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_3);
      __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mx, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_XDECREF_SET(__pyx_v_my, __pyx_t_13);
      __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_mask, __pyx_t_14);
      __pyx_t_14 = 0;

      /* "renpy/display/render.pyx":1220
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:
 * 
 *                 if xo is None:             # <<<<<<<<<<<<<<
 *                     continue
 * 
 */
      __pyx_t_1 = (__pyx_v_xo == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "renpy/display/render.pyx":1221
 * 
 *                 if xo is None:
 *                     continue             # <<<<<<<<<<<<<<
 * 
 *                 elif mx is not None:
 */
        goto __pyx_L15_continue;
      }

      /* "renpy/display/render.pyx":1223
 *                     continue
 * 
 *                 elif mx is not None:             # <<<<<<<<<<<<<<
 *                     cx = x - mx
 *                     cy = y - my
 */
      __pyx_t_2 = (__pyx_v_mx != Py_None);
      __pyx_t_1 = (__pyx_t_2 != 0);
      if (__pyx_t_1) {

        /* "renpy/display/render.pyx":1224
 * 
 *                 elif mx is not None:
 *                     cx = x - mx             # <<<<<<<<<<<<<<
 *                     cy = y - my
 * 
 */
        __pyx_t_4 = PyNumber_Subtract(__pyx_v_x, __pyx_v_mx); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "renpy/display/render.pyx":1225
 *                 elif mx is not None:
 *                     cx = x - mx
 *                     cy = y - my             # <<<<<<<<<<<<<<
 * 
 *                     if self.forward:
 */
        __pyx_t_4 = PyNumber_Subtract(__pyx_v_y, __pyx_v_my); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "renpy/display/render.pyx":1227
 *                     cy = y - my
 * 
 *                     if self.forward:             # <<<<<<<<<<<<<<
 *                         cx, cy = self.forward.transform(cx, cy)
 * 
 */
        __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->forward)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (__pyx_t_1) {

          /* "renpy/display/render.pyx":1228
 * 
 *                     if self.forward:
 *                         cx, cy = self.forward.transform(cx, cy)             # <<<<<<<<<<<<<<
 * 
 *                     if isinstance(mask, Render):
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_13 = NULL;
          __pyx_t_17 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_14);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_14, function);
              __pyx_t_17 = 1;
            }
          }
          __pyx_t_12 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          if (__pyx_t_13) {
            PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_INCREF(__pyx_v_cx);
          PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_17, __pyx_v_cx);
          __Pyx_GIVEREF(__pyx_v_cx);
          __Pyx_INCREF(__pyx_v_cy);
          PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_17, __pyx_v_cy);
          __Pyx_GIVEREF(__pyx_v_cy);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
            PyObject* sequence = __pyx_t_4;
            #if CYTHON_COMPILING_IN_CPYTHON
            Py_ssize_t size = Py_SIZE(sequence);
            #else
            Py_ssize_t size = PySequence_Size(sequence);
            #endif
            if (unlikely(size != 2)) {
              if (size > 2) __Pyx_RaiseTooManyValuesError(2);
              else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
              {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            }
            #if CYTHON_COMPILING_IN_CPYTHON
            if (likely(PyTuple_CheckExact(sequence))) {
              __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
              __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
            } else {
              __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
              __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
            }
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_12);
            #else
            __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_12);
            #endif
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          } else {
            Py_ssize_t index = -1;
            __pyx_t_13 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_16 = Py_TYPE(__pyx_t_13)->tp_iternext;
            index = 0; __pyx_t_14 = __pyx_t_16(__pyx_t_13); if (unlikely(!__pyx_t_14)) goto __pyx_L21_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_14);
            index = 1; __pyx_t_12 = __pyx_t_16(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L21_unpacking_failed;
            __Pyx_GOTREF(__pyx_t_12);
            if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_13), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_t_16 = NULL;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            goto __pyx_L22_unpacking_done;
            __pyx_L21_unpacking_failed:;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_16 = NULL;
            if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
            {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __pyx_L22_unpacking_done:;
          }
          __Pyx_DECREF_SET(__pyx_v_cx, __pyx_t_14);
          __pyx_t_14 = 0;
          __Pyx_DECREF_SET(__pyx_v_cy, __pyx_t_12);
          __pyx_t_12 = 0;
          goto __pyx_L20;
        }
        __pyx_L20:;

        /* "renpy/display/render.pyx":1230
 *                         cx, cy = self.forward.transform(cx, cy)
 * 
 *                     if isinstance(mask, Render):             # <<<<<<<<<<<<<<
 *                         if mask.is_pixel_opaque(cx, cy):
 *                             rv = d, arg, screen
 */
        __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_mask, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
        __pyx_t_2 = (__pyx_t_1 != 0);
        if (__pyx_t_2) {

          /* "renpy/display/render.pyx":1231
 * 
 *                     if isinstance(mask, Render):
 *                         if mask.is_pixel_opaque(cx, cy):             # <<<<<<<<<<<<<<
 *                             rv = d, arg, screen
 *                     else:
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_n_s_is_pixel_opaque); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_14 = NULL;
          __pyx_t_17 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_14)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_14);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_17 = 1;
            }
          }
          __pyx_t_13 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_13);
          if (__pyx_t_14) {
            PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
          }
          __Pyx_INCREF(__pyx_v_cx);
          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_17, __pyx_v_cx);
          __Pyx_GIVEREF(__pyx_v_cx);
          __Pyx_INCREF(__pyx_v_cy);
          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_17, __pyx_v_cy);
          __Pyx_GIVEREF(__pyx_v_cy);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "renpy/display/render.pyx":1232
 *                     if isinstance(mask, Render):
 *                         if mask.is_pixel_opaque(cx, cy):
 *                             rv = d, arg, screen             # <<<<<<<<<<<<<<
 *                     else:
 *                         if mask(cx, cy):
 */
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_v_d);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_d);
            __Pyx_GIVEREF(__pyx_v_d);
            __Pyx_INCREF(__pyx_v_arg);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_arg);
            __Pyx_GIVEREF(__pyx_v_arg);
            __Pyx_INCREF(__pyx_v_screen);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_screen);
            __Pyx_GIVEREF(__pyx_v_screen);
            __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_4);
            __pyx_t_4 = 0;
            goto __pyx_L24;
          }
          __pyx_L24:;
          goto __pyx_L23;
        }
        /*else*/ {

          /* "renpy/display/render.pyx":1234
 *                             rv = d, arg, screen
 *                     else:
 *                         if mask(cx, cy):             # <<<<<<<<<<<<<<
 *                             rv = d, arg, screen
 * 
 */
          __Pyx_INCREF(__pyx_v_mask);
          __pyx_t_12 = __pyx_v_mask; __pyx_t_13 = NULL;
          __pyx_t_17 = 0;
          if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_13)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_13);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_17 = 1;
            }
          }
          __pyx_t_14 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_14);
          if (__pyx_t_13) {
            PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
          }
          __Pyx_INCREF(__pyx_v_cx);
          PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_17, __pyx_v_cx);
          __Pyx_GIVEREF(__pyx_v_cx);
          __Pyx_INCREF(__pyx_v_cy);
          PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_17, __pyx_v_cy);
          __Pyx_GIVEREF(__pyx_v_cy);
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "renpy/display/render.pyx":1235
 *                     else:
 *                         if mask(cx, cy):
 *                             rv = d, arg, screen             # <<<<<<<<<<<<<<
 * 
 *                 elif xo <= x < xo + w and yo <= y < yo + h:
 */
            __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_v_d);
            PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_d);
            __Pyx_GIVEREF(__pyx_v_d);
            __Pyx_INCREF(__pyx_v_arg);
            PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_arg);
            __Pyx_GIVEREF(__pyx_v_arg);
            __Pyx_INCREF(__pyx_v_screen);
            PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_screen);
            __Pyx_GIVEREF(__pyx_v_screen);
            __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_4);
            __pyx_t_4 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;
        }
        __pyx_L23:;
        goto __pyx_L19;
      }

      /* "renpy/display/render.pyx":1237
 *                             rv = d, arg, screen
 * 
 *                 elif xo <= x < xo + w and yo <= y < yo + h:             # <<<<<<<<<<<<<<
 *                     rv = d, arg, screen
 * 
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_xo, __pyx_v_x, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
        __Pyx_DECREF(__pyx_t_4);
        __pyx_t_12 = PyNumber_Add(__pyx_v_xo, __pyx_v_w); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_12, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {
      } else {
        __pyx_t_2 = __pyx_t_1;
        goto __pyx_L26_bool_binop_done;
      }
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_yo, __pyx_v_y, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
        __Pyx_DECREF(__pyx_t_4);
        __pyx_t_12 = PyNumber_Add(__pyx_v_yo, __pyx_v_h); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_4 = PyObject_RichCompare(__pyx_v_y, __pyx_t_12, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = __pyx_t_1;
      __pyx_L26_bool_binop_done:;
      if (__pyx_t_2) {

        /* "renpy/display/render.pyx":1238
 * 
 *                 elif xo <= x < xo + w and yo <= y < yo + h:
 *                     rv = d, arg, screen             # <<<<<<<<<<<<<<
 * 
 *         for child, xo, yo, focus, main in self.children:
 */
        __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_v_d);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_d);
        __Pyx_GIVEREF(__pyx_v_d);
        __Pyx_INCREF(__pyx_v_arg);
        PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_arg);
        __Pyx_GIVEREF(__pyx_v_arg);
        __Pyx_INCREF(__pyx_v_screen);
        PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_screen);
        __Pyx_GIVEREF(__pyx_v_screen);
        __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_4);
        __pyx_t_4 = 0;
        goto __pyx_L19;
      }
      __pyx_L19:;

      /* "renpy/display/render.pyx":1218
 * 
 *         if self.focuses:
 *             for (d, arg, xo, yo, w, h, mx, my, mask) in self.focuses:             # <<<<<<<<<<<<<<
 * 
 *                 if xo is None:
 */
      __pyx_L15_continue:;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "renpy/display/render.pyx":1240
 *                     rv = d, arg, screen
 * 
 *         for child, xo, yo, focus, main in self.children:             # <<<<<<<<<<<<<<
 * 
 *             if not focus or not isinstance(child, Render):
 */
  if (unlikely(__pyx_v_self->children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_5 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_13 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_14 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_13 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_10);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_12,&__pyx_t_14,&__pyx_t_13,&__pyx_t_11,&__pyx_t_10};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_12,&__pyx_t_14,&__pyx_t_13,&__pyx_t_11,&__pyx_t_10};
      __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_16(__pyx_t_9); if (unlikely(!item)) goto __pyx_L30_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_9), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_16 = NULL;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L31_unpacking_done;
      __pyx_L30_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_16 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L31_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_12);
    __pyx_t_12 = 0;
    __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_13);
    __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "renpy/display/render.pyx":1242
 *         for child, xo, yo, focus, main in self.children:
 * 
 *             if not focus or not isinstance(child, Render):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_focus); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_18 = ((!__pyx_t_1) != 0);
    if (!__pyx_t_18) {
    } else {
      __pyx_t_2 = __pyx_t_18;
      goto __pyx_L33_bool_binop_done;
    }
    __pyx_t_18 = __Pyx_TypeCheck(__pyx_v_child, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
    __pyx_t_1 = ((!(__pyx_t_18 != 0)) != 0);
    __pyx_t_2 = __pyx_t_1;
    __pyx_L33_bool_binop_done:;
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":1243
 * 
 *             if not focus or not isinstance(child, Render):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             cx = x - xo
 */
      goto __pyx_L28_continue;
    }

    /* "renpy/display/render.pyx":1245
 *                 continue
 * 
 *             cx = x - xo             # <<<<<<<<<<<<<<
 *             cy = y - yo
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_x, __pyx_v_xo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1246
 * 
 *             cx = x - xo
 *             cy = y - yo             # <<<<<<<<<<<<<<
 * 
 *             if self.forward:
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_y, __pyx_v_yo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1248
 *             cy = y - yo
 * 
 *             if self.forward:             # <<<<<<<<<<<<<<
 *                 cx, cy = self.forward.transform(cx, cy)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->forward)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":1249
 * 
 *             if self.forward:
 *                 cx, cy = self.forward.transform(cx, cy)             # <<<<<<<<<<<<<<
 * 
 *             cf = child.focus_at_point(cx, cy, screen)
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_13 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      if (__pyx_t_11) {
        PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cx);
      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_17, __pyx_v_cx);
      __Pyx_GIVEREF(__pyx_v_cx);
      __Pyx_INCREF(__pyx_v_cy);
      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_17, __pyx_v_cy);
      __Pyx_GIVEREF(__pyx_v_cy);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
        PyObject* sequence = __pyx_t_4;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_10 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_13 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_13);
        #else
        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        #endif
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_16 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_10 = __pyx_t_16(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L36_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        index = 1; __pyx_t_13 = __pyx_t_16(__pyx_t_11); if (unlikely(!__pyx_t_13)) goto __pyx_L36_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_13);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_16 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L37_unpacking_done;
        __pyx_L36_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_16 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L37_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_cx, __pyx_t_10);
      __pyx_t_10 = 0;
      __Pyx_DECREF_SET(__pyx_v_cy, __pyx_t_13);
      __pyx_t_13 = 0;
      goto __pyx_L35;
    }
    __pyx_L35:;

    /* "renpy/display/render.pyx":1251
 *                 cx, cy = self.forward.transform(cx, cy)
 * 
 *             cf = child.focus_at_point(cx, cy, screen)             # <<<<<<<<<<<<<<
 *             if cf is not None:
 *                 rv = cf
 */
    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_focus_at_point); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_13);
    __pyx_t_10 = NULL;
    __pyx_t_17 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
      __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
      if (likely(__pyx_t_10)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
        __Pyx_INCREF(__pyx_t_10);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_13, function);
        __pyx_t_17 = 1;
      }
    }
    __pyx_t_11 = PyTuple_New(3+__pyx_t_17); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    if (__pyx_t_10) {
      PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
    }
    __Pyx_INCREF(__pyx_v_cx);
    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_17, __pyx_v_cx);
    __Pyx_GIVEREF(__pyx_v_cx);
    __Pyx_INCREF(__pyx_v_cy);
    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_17, __pyx_v_cy);
    __Pyx_GIVEREF(__pyx_v_cy);
    __Pyx_INCREF(__pyx_v_screen);
    PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_17, __pyx_v_screen);
    __Pyx_GIVEREF(__pyx_v_screen);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF_SET(__pyx_v_cf, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "renpy/display/render.pyx":1252
 * 
 *             cf = child.focus_at_point(cx, cy, screen)
 *             if cf is not None:             # <<<<<<<<<<<<<<
 *                 rv = cf
 * 
 */
    __pyx_t_2 = (__pyx_v_cf != Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":1253
 *             cf = child.focus_at_point(cx, cy, screen)
 *             if cf is not None:
 *                 rv = cf             # <<<<<<<<<<<<<<
 * 
 *         if self.pass_focuses:
 */
      __Pyx_INCREF(__pyx_v_cf);
      __Pyx_DECREF_SET(__pyx_v_rv, __pyx_v_cf);
      goto __pyx_L38;
    }
    __pyx_L38:;

    /* "renpy/display/render.pyx":1240
 *                     rv = d, arg, screen
 * 
 *         for child, xo, yo, focus, main in self.children:             # <<<<<<<<<<<<<<
 * 
 *             if not focus or not isinstance(child, Render):
 */
    __pyx_L28_continue:;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "renpy/display/render.pyx":1255
 *                 rv = cf
 * 
 *         if self.pass_focuses:             # <<<<<<<<<<<<<<
 *             for child in self.pass_focuses:
 *                 cf = child.focus_at_point(x, y, screen)
 */
  __pyx_t_1 = (__pyx_v_self->pass_focuses != Py_None) && (PyList_GET_SIZE(__pyx_v_self->pass_focuses) != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1256
 * 
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:             # <<<<<<<<<<<<<<
 *                 cf = child.focus_at_point(x, y, screen)
 *                 if cf is not None:
 */
    if (unlikely(__pyx_v_self->pass_focuses == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_t_5 = __pyx_v_self->pass_focuses; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
    for (;;) {
      if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #else
      __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
      __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "renpy/display/render.pyx":1257
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:
 *                 cf = child.focus_at_point(x, y, screen)             # <<<<<<<<<<<<<<
 *                 if cf is not None:
 *                     rv = cf
 */
      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_focus_at_point); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_11 = NULL;
      __pyx_t_17 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_13))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_13);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_13, function);
          __pyx_t_17 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(3+__pyx_t_17); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_11) {
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_INCREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_17, __pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      __Pyx_INCREF(__pyx_v_y);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_17, __pyx_v_y);
      __Pyx_GIVEREF(__pyx_v_y);
      __Pyx_INCREF(__pyx_v_screen);
      PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_17, __pyx_v_screen);
      __Pyx_GIVEREF(__pyx_v_screen);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cf, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "renpy/display/render.pyx":1258
 *             for child in self.pass_focuses:
 *                 cf = child.focus_at_point(x, y, screen)
 *                 if cf is not None:             # <<<<<<<<<<<<<<
 *                     rv = cf
 * 
 */
      __pyx_t_1 = (__pyx_v_cf != Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "renpy/display/render.pyx":1259
 *                 cf = child.focus_at_point(x, y, screen)
 *                 if cf is not None:
 *                     rv = cf             # <<<<<<<<<<<<<<
 * 
 *         if rv is None and self.modal:
 */
        __Pyx_INCREF(__pyx_v_cf);
        __Pyx_DECREF_SET(__pyx_v_rv, __pyx_v_cf);
        goto __pyx_L42;
      }
      __pyx_L42:;

      /* "renpy/display/render.pyx":1256
 * 
 *         if self.pass_focuses:
 *             for child in self.pass_focuses:             # <<<<<<<<<<<<<<
 *                 cf = child.focus_at_point(x, y, screen)
 *                 if cf is not None:
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L39;
  }
  __pyx_L39:;

  /* "renpy/display/render.pyx":1261
 *                     rv = cf
 * 
 *         if rv is None and self.modal:             # <<<<<<<<<<<<<<
 *             rv = Modal
 * 
 */
  __pyx_t_1 = (__pyx_v_rv == Py_None);
  __pyx_t_18 = (__pyx_t_1 != 0);
  if (__pyx_t_18) {
  } else {
    __pyx_t_2 = __pyx_t_18;
    goto __pyx_L44_bool_binop_done;
  }
  __pyx_t_18 = (__pyx_v_self->modal != 0);
  __pyx_t_2 = __pyx_t_18;
  __pyx_L44_bool_binop_done:;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1262
 * 
 *         if rv is None and self.modal:
 *             rv = Modal             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Modal); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_rv, __pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L43;
  }
  __pyx_L43:;

  /* "renpy/display/render.pyx":1264
 *             rv = Modal
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1195
 *                 child.take_focuses(cminx, cminy, cmaxx, cmaxy, reverse, x, y, screen, focuses)
 * 
 *     def focus_at_point(self, x, y, screen): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         """
 *         This returns the focus of this object at the given point.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_AddTraceback("renpy.display.render.Render.focus_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XDECREF(__pyx_v_mx);
  __Pyx_XDECREF(__pyx_v_my);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XDECREF(__pyx_v_cx);
  __Pyx_XDECREF(__pyx_v_cy);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_cf);
  __Pyx_XDECREF(__pyx_v_screen);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1267
 * 
 * 
 *     def main_displayables_at_point(self, x, y, layers, depth=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the displayable at `x`, `y` on one of the layers in
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_33main_displayables_at_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_32main_displayables_at_point[] = "\n        Returns the displayable at `x`, `y` on one of the layers in\n        the set or list `layers`.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_33main_displayables_at_point(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_layers = 0;
  PyObject *__pyx_v_depth = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("main_displayables_at_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_layers,&__pyx_n_s_depth,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("main_displayables_at_point", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_layers)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("main_displayables_at_point", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_depth);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "main_displayables_at_point") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
    __pyx_v_layers = values[2];
    __pyx_v_depth = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("main_displayables_at_point", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.main_displayables_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_32main_displayables_at_point(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_layers, __pyx_v_depth);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_32main_displayables_at_point(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_layers, PyObject *__pyx_v_depth) {
  PyObject *__pyx_v_rv = NULL;
  int __pyx_v_is_screen;
  PyObject *__pyx_v_d = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_focus = NULL;
  PyObject *__pyx_v_main = NULL;
  PyObject *__pyx_v_cx = NULL;
  PyObject *__pyx_v_cy = NULL;
  PyObject *__pyx_v_cf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  int __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("main_displayables_at_point", 0);
  __Pyx_INCREF(__pyx_v_depth);

  /* "renpy/display/render.pyx":1273
 *         """
 * 
 *         rv = [ ]             # <<<<<<<<<<<<<<
 * 
 *         if x < 0 or y < 0 or x >= self.width or y >= self.height:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_rv = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1275
 *         rv = [ ]
 * 
 *         if x < 0 or y < 0 or x >= self.width or y >= self.height:             # <<<<<<<<<<<<<<
 *             return rv
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1276
 * 
 *         if x < 0 or y < 0 or x >= self.width or y >= self.height:
 *             return rv             # <<<<<<<<<<<<<<
 * 
 *         is_screen = False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_rv);
    __pyx_r = __pyx_v_rv;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1278
 *             return rv
 * 
 *         is_screen = False             # <<<<<<<<<<<<<<
 * 
 *         if depth is not None:
 */
  __pyx_v_is_screen = 0;

  /* "renpy/display/render.pyx":1280
 *         is_screen = False
 * 
 *         if depth is not None:             # <<<<<<<<<<<<<<
 *             for d in self.render_of:
 *                 rv.append((depth, self.width, self.height, d))
 */
  __pyx_t_2 = (__pyx_v_depth != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":1281
 * 
 *         if depth is not None:
 *             for d in self.render_of:             # <<<<<<<<<<<<<<
 *                 rv.append((depth, self.width, self.height, d))
 *                 depth += 1
 */
    if (likely(PyList_CheckExact(__pyx_v_self->render_of)) || PyTuple_CheckExact(__pyx_v_self->render_of)) {
      __pyx_t_1 = __pyx_v_self->render_of; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->render_of); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_6(__pyx_t_1);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "renpy/display/render.pyx":1282
 *         if depth is not None:
 *             for d in self.render_of:
 *                 rv.append((depth, self.width, self.height, d))             # <<<<<<<<<<<<<<
 *                 depth += 1
 * 
 */
      __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_v_depth);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_depth);
      __Pyx_GIVEREF(__pyx_v_depth);
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_d);
      PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_d);
      __Pyx_GIVEREF(__pyx_v_d);
      __pyx_t_4 = 0;
      __pyx_t_7 = 0;
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_rv, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "renpy/display/render.pyx":1283
 *             for d in self.render_of:
 *                 rv.append((depth, self.width, self.height, d))
 *                 depth += 1             # <<<<<<<<<<<<<<
 * 
 *                 if isinstance(d, renpy.display.screen.ScreenDisplayable):
 */
      __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_depth, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_depth, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "renpy/display/render.pyx":1285
 *                 depth += 1
 * 
 *                 if isinstance(d, renpy.display.screen.ScreenDisplayable):             # <<<<<<<<<<<<<<
 *                     is_screen = True
 * 
 */
      __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_display); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_screen); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ScreenDisplayable); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_3 = PyObject_IsInstance(__pyx_v_d, __pyx_t_7); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "renpy/display/render.pyx":1286
 * 
 *                 if isinstance(d, renpy.display.screen.ScreenDisplayable):
 *                     is_screen = True             # <<<<<<<<<<<<<<
 * 
 *         elif self.layer_name in layers:
 */
        __pyx_v_is_screen = 1;
        goto __pyx_L11;
      }
      __pyx_L11:;

      /* "renpy/display/render.pyx":1281
 * 
 *         if depth is not None:
 *             for d in self.render_of:             # <<<<<<<<<<<<<<
 *                 rv.append((depth, self.width, self.height, d))
 *                 depth += 1
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L8;
  }

  /* "renpy/display/render.pyx":1288
 *                     is_screen = True
 * 
 *         elif self.layer_name in layers:             # <<<<<<<<<<<<<<
 *             depth = 0
 * 
 */
  __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_v_self->layer_name, __pyx_v_layers, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":1289
 * 
 *         elif self.layer_name in layers:
 *             depth = 0             # <<<<<<<<<<<<<<
 * 
 *         for (child, xo, yo, focus, main) in self.children:
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_DECREF_SET(__pyx_v_depth, __pyx_int_0);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "renpy/display/render.pyx":1291
 *             depth = 0
 * 
 *         for (child, xo, yo, focus, main) in self.children:             # <<<<<<<<<<<<<<
 *             if not main or not isinstance(child, Render):
 *                 continue
 */
  if (unlikely(__pyx_v_self->children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
      PyObject* sequence = __pyx_t_7;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_12 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_11 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_12 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_8,&__pyx_t_4,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_8,&__pyx_t_4,&__pyx_t_10,&__pyx_t_11,&__pyx_t_12};
      __pyx_t_13 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_14(__pyx_t_13); if (unlikely(!item)) goto __pyx_L14_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_14 = NULL;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L15_unpacking_done;
      __pyx_L14_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_14 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L15_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_4);
    __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_10);
    __pyx_t_10 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_11);
    __pyx_t_11 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_12);
    __pyx_t_12 = 0;

    /* "renpy/display/render.pyx":1292
 * 
 *         for (child, xo, yo, focus, main) in self.children:
 *             if not main or not isinstance(child, Render):             # <<<<<<<<<<<<<<
 *                 continue
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_main); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_15 = ((!__pyx_t_2) != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_3 = __pyx_t_15;
      goto __pyx_L17_bool_binop_done;
    }
    __pyx_t_15 = __Pyx_TypeCheck(__pyx_v_child, ((PyObject*)__pyx_ptype_5renpy_7display_6render_Render)); 
    __pyx_t_2 = ((!(__pyx_t_15 != 0)) != 0);
    __pyx_t_3 = __pyx_t_2;
    __pyx_L17_bool_binop_done:;
    if (__pyx_t_3) {

      /* "renpy/display/render.pyx":1293
 *         for (child, xo, yo, focus, main) in self.children:
 *             if not main or not isinstance(child, Render):
 *                 continue             # <<<<<<<<<<<<<<
 * 
 *             cx = x - xo
 */
      goto __pyx_L12_continue;
    }

    /* "renpy/display/render.pyx":1295
 *                 continue
 * 
 *             cx = x - xo             # <<<<<<<<<<<<<<
 *             cy = y - yo
 * 
 */
    __pyx_t_7 = PyNumber_Subtract(__pyx_v_x, __pyx_v_xo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_cx, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "renpy/display/render.pyx":1296
 * 
 *             cx = x - xo
 *             cy = y - yo             # <<<<<<<<<<<<<<
 * 
 *             if self.forward:
 */
    __pyx_t_7 = PyNumber_Subtract(__pyx_v_y, __pyx_v_yo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_XDECREF_SET(__pyx_v_cy, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "renpy/display/render.pyx":1298
 *             cy = y - yo
 * 
 *             if self.forward:             # <<<<<<<<<<<<<<
 *                 cx, cy = self.forward.transform(cx, cy)
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->forward)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_3) {

      /* "renpy/display/render.pyx":1299
 * 
 *             if self.forward:
 *                 cx, cy = self.forward.transform(cx, cy)             # <<<<<<<<<<<<<<
 * 
 *             if is_screen:
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->forward), __pyx_n_s_transform); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_12, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_16); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_11) {
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cx);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_16, __pyx_v_cx);
      __Pyx_GIVEREF(__pyx_v_cx);
      __Pyx_INCREF(__pyx_v_cy);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_16, __pyx_v_cy);
      __Pyx_GIVEREF(__pyx_v_cy);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
        PyObject* sequence = __pyx_t_7;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_12 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_12 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_14 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_12 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_12)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        index = 1; __pyx_t_10 = __pyx_t_14(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L20_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_14 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L21_unpacking_done;
        __pyx_L20_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_14 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L21_unpacking_done:;
      }
      __Pyx_DECREF_SET(__pyx_v_cx, __pyx_t_12);
      __pyx_t_12 = 0;
      __Pyx_DECREF_SET(__pyx_v_cy, __pyx_t_10);
      __pyx_t_10 = 0;
      goto __pyx_L19;
    }
    __pyx_L19:;

    /* "renpy/display/render.pyx":1301
 *                 cx, cy = self.forward.transform(cx, cy)
 * 
 *             if is_screen:             # <<<<<<<<<<<<<<
 *                 # Ignore the fixed at the root of every screen.
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth - 1)
 */
    __pyx_t_3 = (__pyx_v_is_screen != 0);
    if (__pyx_t_3) {

      /* "renpy/display/render.pyx":1303
 *             if is_screen:
 *                 # Ignore the fixed at the root of every screen.
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth - 1)             # <<<<<<<<<<<<<<
 *                 rv.extend(cf[1:])
 *             else:
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_main_displayables_at_point); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_12 = PyNumber_Subtract(__pyx_v_depth, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_4 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_11) {
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cx);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_16, __pyx_v_cx);
      __Pyx_GIVEREF(__pyx_v_cx);
      __Pyx_INCREF(__pyx_v_cy);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_16, __pyx_v_cy);
      __Pyx_GIVEREF(__pyx_v_cy);
      __Pyx_INCREF(__pyx_v_layers);
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_16, __pyx_v_layers);
      __Pyx_GIVEREF(__pyx_v_layers);
      PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_16, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_12 = 0;
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cf, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "renpy/display/render.pyx":1304
 *                 # Ignore the fixed at the root of every screen.
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth - 1)
 *                 rv.extend(cf[1:])             # <<<<<<<<<<<<<<
 *             else:
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth)
 */
      __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_cf, 1, 0, NULL, NULL, &__pyx_slice__10, 1, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_rv, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L22;
    }
    /*else*/ {

      /* "renpy/display/render.pyx":1306
 *                 rv.extend(cf[1:])
 *             else:
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth)             # <<<<<<<<<<<<<<
 *                 rv.extend(cf)
 * 
 */
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_main_displayables_at_point); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = NULL;
      __pyx_t_16 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_10, function);
          __pyx_t_16 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(4+__pyx_t_16); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      if (__pyx_t_4) {
        PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_cx);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_16, __pyx_v_cx);
      __Pyx_GIVEREF(__pyx_v_cx);
      __Pyx_INCREF(__pyx_v_cy);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_16, __pyx_v_cy);
      __Pyx_GIVEREF(__pyx_v_cy);
      __Pyx_INCREF(__pyx_v_layers);
      PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_16, __pyx_v_layers);
      __Pyx_GIVEREF(__pyx_v_layers);
      __Pyx_INCREF(__pyx_v_depth);
      PyTuple_SET_ITEM(__pyx_t_12, 3+__pyx_t_16, __pyx_v_depth);
      __Pyx_GIVEREF(__pyx_v_depth);
      __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF_SET(__pyx_v_cf, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "renpy/display/render.pyx":1307
 *             else:
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth)
 *                 rv.extend(cf)             # <<<<<<<<<<<<<<
 * 
 *         return rv
 */
      __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_rv, __pyx_v_cf); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L22:;

    /* "renpy/display/render.pyx":1291
 *             depth = 0
 * 
 *         for (child, xo, yo, focus, main) in self.children:             # <<<<<<<<<<<<<<
 *             if not main or not isinstance(child, Render):
 *                 continue
 */
    __pyx_L12_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1309
 *                 rv.extend(cf)
 * 
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_rv);
  __pyx_r = __pyx_v_rv;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1267
 * 
 * 
 *     def main_displayables_at_point(self, x, y, layers, depth=None):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the displayable at `x`, `y` on one of the layers in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("renpy.display.render.Render.main_displayables_at_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rv);
  __Pyx_XDECREF(__pyx_v_d);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_cx);
  __Pyx_XDECREF(__pyx_v_cy);
  __Pyx_XDECREF(__pyx_v_cf);
  __Pyx_XDECREF(__pyx_v_depth);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1312
 * 
 * 
 *     def is_opaque(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if this displayable is opaque, or False otherwise.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_35is_opaque(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_34is_opaque[] = "\n        Returns true if this displayable is opaque, or False otherwise.\n        Also sets self.visible_children.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_35is_opaque(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_opaque (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_34is_opaque(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_34is_opaque(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_v_rv;
  PyObject *__pyx_v_vc = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_v_xo = NULL;
  PyObject *__pyx_v_yo = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_focus = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_main = NULL;
  PyObject *__pyx_v_cw = NULL;
  PyObject *__pyx_v_ch = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_opaque", 0);

  /* "renpy/display/render.pyx":1318
 *         """
 * 
 *         if self.opaque is not None:             # <<<<<<<<<<<<<<
 *             return self.opaque
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":1319
 * 
 *         if self.opaque is not None:
 *             return self.opaque             # <<<<<<<<<<<<<<
 * 
 *         # A rotated image is never opaque. (This isn't actually true, but it
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1323
 *         # A rotated image is never opaque. (This isn't actually true, but it
 *         # saves us from the expensive calculations require to prove it is.)
 *         if self.forward:             # <<<<<<<<<<<<<<
 *             self.opaque = False
 *             return False
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_self->forward)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

    /* "renpy/display/render.pyx":1324
 *         # saves us from the expensive calculations require to prove it is.)
 *         if self.forward:
 *             self.opaque = False             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
    __pyx_v_self->opaque = 0;

    /* "renpy/display/render.pyx":1325
 *         if self.forward:
 *             self.opaque = False
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         rv = False
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1327
 *             return False
 * 
 *         rv = False             # <<<<<<<<<<<<<<
 *         vc = [ ]
 * 
 */
  __pyx_v_rv = 0;

  /* "renpy/display/render.pyx":1328
 * 
 *         rv = False
 *         vc = [ ]             # <<<<<<<<<<<<<<
 * 
 *         for i in self.children:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_vc = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1330
 *         vc = [ ]
 * 
 *         for i in self.children:             # <<<<<<<<<<<<<<
 *             child, xo, yo, focus, main = i
 * 
 */
  if (unlikely(__pyx_v_self->children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_1 = __pyx_v_self->children; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1331
 * 
 *         for i in self.children:
 *             child, xo, yo, focus, main = i             # <<<<<<<<<<<<<<
 * 
 *             if xo <= 0 and yo <= 0:
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_i))) || (PyList_CheckExact(__pyx_v_i))) {
      PyObject* sequence = __pyx_v_i;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 5)) {
        if (size > 5) __Pyx_RaiseTooManyValuesError(5);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 2); 
        __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3); 
        __pyx_t_9 = PyTuple_GET_ITEM(sequence, 4); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 2); 
        __pyx_t_8 = PyList_GET_ITEM(sequence, 3); 
        __pyx_t_9 = PyList_GET_ITEM(sequence, 4); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_9);
      #else
      {
        Py_ssize_t i;
        PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
        for (i=0; i < 5; i++) {
          PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(item);
          *(temps[i]) = item;
        }
      }
      #endif
    } else {
      Py_ssize_t index = -1;
      PyObject** temps[5] = {&__pyx_t_5,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
      __pyx_t_10 = PyObject_GetIter(__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
      for (index=0; index < 5; index++) {
        PyObject* item = __pyx_t_11(__pyx_t_10); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
        __Pyx_GOTREF(item);
        *(temps[index]) = item;
      }
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_xo, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yo, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_focus, __pyx_t_8);
    __pyx_t_8 = 0;
    __Pyx_XDECREF_SET(__pyx_v_main, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "renpy/display/render.pyx":1333
 *             child, xo, yo, focus, main = i
 * 
 *             if xo <= 0 and yo <= 0:             # <<<<<<<<<<<<<<
 *                 cw, ch = child.get_size()
 *                 if cw + xo < self.width or ch + yo < self.height:
 */
    __pyx_t_9 = PyObject_RichCompare(__pyx_v_xo, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (__pyx_t_2) {
    } else {
      __pyx_t_3 = __pyx_t_2;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_9 = PyObject_RichCompare(__pyx_v_yo, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_3 = __pyx_t_2;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_3) {

      /* "renpy/display/render.pyx":1334
 * 
 *             if xo <= 0 and yo <= 0:
 *                 cw, ch = child.get_size()             # <<<<<<<<<<<<<<
 *                 if cw + xo < self.width or ch + yo < self.height:
 *                     if child.is_opaque():
 */
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_get_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
        PyObject* sequence = __pyx_t_9;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_8 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_8)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        index = 1; __pyx_t_7 = __pyx_t_11(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_L13_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_cw, __pyx_t_8);
      __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_ch, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "renpy/display/render.pyx":1335
 *             if xo <= 0 and yo <= 0:
 *                 cw, ch = child.get_size()
 *                 if cw + xo < self.width or ch + yo < self.height:             # <<<<<<<<<<<<<<
 *                     if child.is_opaque():
 *                         vc = [ ]
 */
      __pyx_t_9 = PyNumber_Add(__pyx_v_cw, __pyx_v_xo); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = PyObject_RichCompare(__pyx_t_9, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (!__pyx_t_2) {
      } else {
        __pyx_t_3 = __pyx_t_2;
        goto __pyx_L15_bool_binop_done;
      }
      __pyx_t_8 = PyNumber_Add(__pyx_v_ch, __pyx_v_yo); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_3 = __pyx_t_2;
      __pyx_L15_bool_binop_done:;
      if (__pyx_t_3) {

        /* "renpy/display/render.pyx":1336
 *                 cw, ch = child.get_size()
 *                 if cw + xo < self.width or ch + yo < self.height:
 *                     if child.is_opaque():             # <<<<<<<<<<<<<<
 *                         vc = [ ]
 *                         rv = True
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (__pyx_t_8) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_3) {

          /* "renpy/display/render.pyx":1337
 *                 if cw + xo < self.width or ch + yo < self.height:
 *                     if child.is_opaque():
 *                         vc = [ ]             # <<<<<<<<<<<<<<
 *                         rv = True
 * 
 */
          __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF_SET(__pyx_v_vc, ((PyObject*)__pyx_t_9));
          __pyx_t_9 = 0;

          /* "renpy/display/render.pyx":1338
 *                     if child.is_opaque():
 *                         vc = [ ]
 *                         rv = True             # <<<<<<<<<<<<<<
 * 
 *             vc.append(i)
 */
          __pyx_v_rv = 1;
          goto __pyx_L17;
        }
        __pyx_L17:;
        goto __pyx_L14;
      }
      __pyx_L14:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "renpy/display/render.pyx":1340
 *                         rv = True
 * 
 *             vc.append(i)             # <<<<<<<<<<<<<<
 * 
 *         self.visible_children = vc
 */
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_vc, __pyx_v_i); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "renpy/display/render.pyx":1330
 *         vc = [ ]
 * 
 *         for i in self.children:             # <<<<<<<<<<<<<<
 *             child, xo, yo, focus, main = i
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1342
 *             vc.append(i)
 * 
 *         self.visible_children = vc             # <<<<<<<<<<<<<<
 *         self.opaque = rv
 *         return rv
 */
  __Pyx_INCREF(__pyx_v_vc);
  __Pyx_GIVEREF(__pyx_v_vc);
  __Pyx_GOTREF(__pyx_v_self->visible_children);
  __Pyx_DECREF(__pyx_v_self->visible_children);
  __pyx_v_self->visible_children = __pyx_v_vc;

  /* "renpy/display/render.pyx":1343
 * 
 *         self.visible_children = vc
 *         self.opaque = rv             # <<<<<<<<<<<<<<
 *         return rv
 * 
 */
  __pyx_v_self->opaque = __pyx_v_rv;

  /* "renpy/display/render.pyx":1344
 *         self.visible_children = vc
 *         self.opaque = rv
 *         return rv             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_rv); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1312
 * 
 * 
 *     def is_opaque(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns true if this displayable is opaque, or False otherwise.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("renpy.display.render.Render.is_opaque", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vc);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XDECREF(__pyx_v_xo);
  __Pyx_XDECREF(__pyx_v_yo);
  __Pyx_XDECREF(__pyx_v_focus);
  __Pyx_XDECREF(__pyx_v_main);
  __Pyx_XDECREF(__pyx_v_cw);
  __Pyx_XDECREF(__pyx_v_ch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1347
 * 
 * 
 *     def is_pixel_opaque(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if the pixel at x and y is opaque or not.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_37is_pixel_opaque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_36is_pixel_opaque[] = "\n        Determine if the pixel at x and y is opaque or not.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_37is_pixel_opaque(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_pixel_opaque (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("is_pixel_opaque", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_pixel_opaque") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_x = values[0];
    __pyx_v_y = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_pixel_opaque", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.is_pixel_opaque", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_36is_pixel_opaque(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_x, __pyx_v_y);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_36is_pixel_opaque(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("is_pixel_opaque", 0);

  /* "renpy/display/render.pyx":1352
 *         """
 * 
 *         if x < 0 or y < 0 or x >= self.width or y >= self.height:             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1353
 * 
 *         if x < 0 or y < 0 or x >= self.width or y >= self.height:
 *             return False             # <<<<<<<<<<<<<<
 * 
 *         if self.is_opaque():
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1355
 *             return False
 * 
 *         if self.is_opaque():             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_opaque); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1356
 * 
 *         if self.is_opaque():
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         return renpy.display.draw.is_pixel_opaque(self, x, y)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_True);
    __pyx_r = Py_True;
    goto __pyx_L0;
  }

  /* "renpy/display/render.pyx":1358
 *             return True
 * 
 *         return renpy.display.draw.is_pixel_opaque(self, x, y)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_draw); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_pixel_opaque); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1347
 * 
 * 
 *     def is_pixel_opaque(self, x, y):             # <<<<<<<<<<<<<<
 *         """
 *         Determine if the pixel at x and y is opaque or not.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.is_pixel_opaque", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1361
 * 
 * 
 *     def fill(self, color):             # <<<<<<<<<<<<<<
 *         """
 *         Fills this Render with the given color.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_39fill(PyObject *__pyx_v_self, PyObject *__pyx_v_color); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_38fill[] = "\n        Fills this Render with the given color.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_39fill(PyObject *__pyx_v_self, PyObject *__pyx_v_color) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_38fill(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_color));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_38fill(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_color) {
  PyObject *__pyx_v_solid = NULL;
  PyObject *__pyx_v_surf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  struct __pyx_opt_args_5renpy_7display_6render_6Render_blit __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fill", 0);
  __Pyx_INCREF(__pyx_v_color);

  /* "renpy/display/render.pyx":1366
 *         """
 * 
 *         color = renpy.easy.color(color)             # <<<<<<<<<<<<<<
 *         solid = renpy.display.imagelike.Solid(color)
 *         surf = render(solid, self.width, self.height, 0, 0)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_easy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_color); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(__pyx_v_color);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_color);
    __Pyx_GIVEREF(__pyx_v_color);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_color, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1367
 * 
 *         color = renpy.easy.color(color)
 *         solid = renpy.display.imagelike.Solid(color)             # <<<<<<<<<<<<<<
 *         surf = render(solid, self.width, self.height, 0, 0)
 *         self.blit(surf, (0, 0), focus=False, main=False)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_imagelike); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Solid); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_color); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_color);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_color);
    __Pyx_GIVEREF(__pyx_v_color);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_solid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1368
 *         color = renpy.easy.color(color)
 *         solid = renpy.display.imagelike.Solid(color)
 *         surf = render(solid, self.width, self.height, 0, 0)             # <<<<<<<<<<<<<<
 *         self.blit(surf, (0, 0), focus=False, main=False)
 * 
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_f_5renpy_7display_6render_render(__pyx_v_solid, __pyx_t_1, __pyx_t_4, 0.0, 0.0, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_surf = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1369
 *         solid = renpy.display.imagelike.Solid(color)
 *         surf = render(solid, self.width, self.height, 0, 0)
 *         self.blit(surf, (0, 0), focus=False, main=False)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_6.__pyx_n = 2;
  __pyx_t_6.focus = Py_False;
  __pyx_t_6.main = Py_False;
  __pyx_t_5 = ((struct __pyx_vtabstruct_5renpy_7display_6render_Render *)__pyx_v_self->__pyx_vtab)->blit(__pyx_v_self, __pyx_v_surf, __pyx_tuple__11, 0, &__pyx_t_6); 

  /* "renpy/display/render.pyx":1361
 * 
 * 
 *     def fill(self, color):             # <<<<<<<<<<<<<<
 *         """
 *         Fills this Render with the given color.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("renpy.display.render.Render.fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_solid);
  __Pyx_XDECREF(__pyx_v_surf);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1372
 * 
 * 
 *     def canvas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a canvas object that draws to this Render.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_41canvas(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_40canvas[] = "\n        Returns a canvas object that draws to this Render.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_41canvas(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("canvas (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_40canvas(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_40canvas(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_v_surf = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("canvas", 0);

  /* "renpy/display/render.pyx":1377
 *         """
 * 
 *         surf = renpy.display.pgrender.surface((self.width, self.height), True)             # <<<<<<<<<<<<<<
 * 
 *         mutated_surface(surf)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_display); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pgrender); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_surface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_4) {
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
  }
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_INCREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, Py_True);
  __Pyx_GIVEREF(Py_True);
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_surf = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1379
 *         surf = renpy.display.pgrender.surface((self.width, self.height), True)
 * 
 *         mutated_surface(surf)             # <<<<<<<<<<<<<<
 * 
 *         self.blit(surf, (0, 0))
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_mutated_surface); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_surf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_surf);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_surf);
    __Pyx_GIVEREF(__pyx_v_surf);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1381
 *         mutated_surface(surf)
 * 
 *         self.blit(surf, (0, 0))             # <<<<<<<<<<<<<<
 * 
 *         return Canvas(surf)
 */
  ((struct __pyx_vtabstruct_5renpy_7display_6render_Render *)__pyx_v_self->__pyx_vtab)->blit(__pyx_v_self, __pyx_v_surf, __pyx_tuple__12, 0, NULL);

  /* "renpy/display/render.pyx":1383
 *         self.blit(surf, (0, 0))
 * 
 *         return Canvas(surf)             # <<<<<<<<<<<<<<
 * 
 *     def screen_rect(self, double sx, double sy, Matrix transform):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Canvas); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_surf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_INCREF(__pyx_v_surf);
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_surf);
    __Pyx_GIVEREF(__pyx_v_surf);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1372
 * 
 * 
 *     def canvas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a canvas object that draws to this Render.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.display.render.Render.canvas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_surf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1385
 *         return Canvas(surf)
 * 
 *     def screen_rect(self, double sx, double sy, Matrix transform):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the rectangle, in screen-space coordinates, that will be covered
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_43screen_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_42screen_rect[] = "\n        Returns the rectangle, in screen-space coordinates, that will be covered\n        by this render when it's drawn to the screen at sx, sy, with the transform\n        `transform`.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_43screen_rect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_sx;
  double __pyx_v_sy;
  struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_transform = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("screen_rect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sx,&__pyx_n_s_sy,&__pyx_n_s_transform,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sx)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sy)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("screen_rect", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("screen_rect", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "screen_rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_sx = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_sx == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_sy = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_sy == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_transform = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("screen_rect", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.screen_rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_transform), __pyx_ptype_5renpy_7display_6matrix_Matrix, 1, "transform", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_42screen_rect(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_sx, __pyx_v_sy, __pyx_v_transform);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_42screen_rect(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, double __pyx_v_sx, double __pyx_v_sy, struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_transform) {
  double __pyx_v_w;
  double __pyx_v_h;
  double __pyx_v_xdx;
  double __pyx_v_xdy;
  double __pyx_v_ydx;
  double __pyx_v_ydy;
  double __pyx_v_x0;
  double __pyx_v_y0;
  double __pyx_v_x1;
  double __pyx_v_y1;
  double __pyx_v_x2;
  double __pyx_v_y2;
  double __pyx_v_x3;
  double __pyx_v_y3;
  double __pyx_v_minx;
  double __pyx_v_maxx;
  double __pyx_v_miny;
  double __pyx_v_maxy;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  float __pyx_t_4;
  double __pyx_t_5;
  double __pyx_t_6;
  double __pyx_t_7;
  double __pyx_t_8;
  double __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("screen_rect", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_transform);

  /* "renpy/display/render.pyx":1392
 *         """
 * 
 *         if transform is None:             # <<<<<<<<<<<<<<
 *             transform = IDENTITY
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_transform) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1393
 * 
 *         if transform is None:
 *             transform = IDENTITY             # <<<<<<<<<<<<<<
 * 
 *         cdef double w = self.width
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IDENTITY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_transform, ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_3));
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1395
 *             transform = IDENTITY
 * 
 *         cdef double w = self.width             # <<<<<<<<<<<<<<
 *         cdef double h = self.height
 * 
 */
  __pyx_t_4 = __pyx_v_self->width;
  __pyx_v_w = __pyx_t_4;

  /* "renpy/display/render.pyx":1396
 * 
 *         cdef double w = self.width
 *         cdef double h = self.height             # <<<<<<<<<<<<<<
 * 
 *         cdef double xdx = transform.xdx
 */
  __pyx_t_4 = __pyx_v_self->height;
  __pyx_v_h = __pyx_t_4;

  /* "renpy/display/render.pyx":1398
 *         cdef double h = self.height
 * 
 *         cdef double xdx = transform.xdx             # <<<<<<<<<<<<<<
 *         cdef double xdy = transform.xdy
 *         cdef double ydx = transform.ydx
 */
  __pyx_t_4 = __pyx_v_transform->xdx;
  __pyx_v_xdx = __pyx_t_4;

  /* "renpy/display/render.pyx":1399
 * 
 *         cdef double xdx = transform.xdx
 *         cdef double xdy = transform.xdy             # <<<<<<<<<<<<<<
 *         cdef double ydx = transform.ydx
 *         cdef double ydy = transform.ydy
 */
  __pyx_t_4 = __pyx_v_transform->xdy;
  __pyx_v_xdy = __pyx_t_4;

  /* "renpy/display/render.pyx":1400
 *         cdef double xdx = transform.xdx
 *         cdef double xdy = transform.xdy
 *         cdef double ydx = transform.ydx             # <<<<<<<<<<<<<<
 *         cdef double ydy = transform.ydy
 * 
 */
  __pyx_t_4 = __pyx_v_transform->ydx;
  __pyx_v_ydx = __pyx_t_4;

  /* "renpy/display/render.pyx":1401
 *         cdef double xdy = transform.xdy
 *         cdef double ydx = transform.ydx
 *         cdef double ydy = transform.ydy             # <<<<<<<<<<<<<<
 * 
 *         # Transform the vertex coordinates to screen-space.
 */
  __pyx_t_4 = __pyx_v_transform->ydy;
  __pyx_v_ydy = __pyx_t_4;

  /* "renpy/display/render.pyx":1404
 * 
 *         # Transform the vertex coordinates to screen-space.
 *         cdef double x0 = sx             # <<<<<<<<<<<<<<
 *         cdef double y0 = sy
 * 
 */
  __pyx_v_x0 = __pyx_v_sx;

  /* "renpy/display/render.pyx":1405
 *         # Transform the vertex coordinates to screen-space.
 *         cdef double x0 = sx
 *         cdef double y0 = sy             # <<<<<<<<<<<<<<
 * 
 *         cdef double x1 = w * xdx + sx
 */
  __pyx_v_y0 = __pyx_v_sy;

  /* "renpy/display/render.pyx":1407
 *         cdef double y0 = sy
 * 
 *         cdef double x1 = w * xdx + sx             # <<<<<<<<<<<<<<
 *         cdef double y1 = w * ydx + sy
 * 
 */
  __pyx_v_x1 = ((__pyx_v_w * __pyx_v_xdx) + __pyx_v_sx);

  /* "renpy/display/render.pyx":1408
 * 
 *         cdef double x1 = w * xdx + sx
 *         cdef double y1 = w * ydx + sy             # <<<<<<<<<<<<<<
 * 
 *         cdef double x2 = h * xdy + sx
 */
  __pyx_v_y1 = ((__pyx_v_w * __pyx_v_ydx) + __pyx_v_sy);

  /* "renpy/display/render.pyx":1410
 *         cdef double y1 = w * ydx + sy
 * 
 *         cdef double x2 = h * xdy + sx             # <<<<<<<<<<<<<<
 *         cdef double y2 = h * ydy + sy
 * 
 */
  __pyx_v_x2 = ((__pyx_v_h * __pyx_v_xdy) + __pyx_v_sx);

  /* "renpy/display/render.pyx":1411
 * 
 *         cdef double x2 = h * xdy + sx
 *         cdef double y2 = h * ydy + sy             # <<<<<<<<<<<<<<
 * 
 *         cdef double x3 = w * xdx + h * xdy + sx
 */
  __pyx_v_y2 = ((__pyx_v_h * __pyx_v_ydy) + __pyx_v_sy);

  /* "renpy/display/render.pyx":1413
 *         cdef double y2 = h * ydy + sy
 * 
 *         cdef double x3 = w * xdx + h * xdy + sx             # <<<<<<<<<<<<<<
 *         cdef double y3 = w * ydx + h * ydy + sy
 * 
 */
  __pyx_v_x3 = (((__pyx_v_w * __pyx_v_xdx) + (__pyx_v_h * __pyx_v_xdy)) + __pyx_v_sx);

  /* "renpy/display/render.pyx":1414
 * 
 *         cdef double x3 = w * xdx + h * xdy + sx
 *         cdef double y3 = w * ydx + h * ydy + sy             # <<<<<<<<<<<<<<
 * 
 *         cdef double minx = min(x0, x1, x2, x3)
 */
  __pyx_v_y3 = (((__pyx_v_w * __pyx_v_ydx) + (__pyx_v_h * __pyx_v_ydy)) + __pyx_v_sy);

  /* "renpy/display/render.pyx":1416
 *         cdef double y3 = w * ydx + h * ydy + sy
 * 
 *         cdef double minx = min(x0, x1, x2, x3)             # <<<<<<<<<<<<<<
 *         cdef double maxx = max(x0, x1, x2, x3)
 *         cdef double miny = min(y0, y1, y2, y3)
 */
  __pyx_t_5 = __pyx_v_x1;
  __pyx_t_6 = __pyx_v_x2;
  __pyx_t_7 = __pyx_v_x3;
  __pyx_t_8 = __pyx_v_x0;
  if (((__pyx_t_5 < __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_5;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_t_8 = __pyx_t_9;
  if (((__pyx_t_6 < __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_6;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_t_8 = __pyx_t_9;
  if (((__pyx_t_7 < __pyx_t_8) != 0)) {
    __pyx_t_9 = __pyx_t_7;
  } else {
    __pyx_t_9 = __pyx_t_8;
  }
  __pyx_v_minx = __pyx_t_9;

  /* "renpy/display/render.pyx":1417
 * 
 *         cdef double minx = min(x0, x1, x2, x3)
 *         cdef double maxx = max(x0, x1, x2, x3)             # <<<<<<<<<<<<<<
 *         cdef double miny = min(y0, y1, y2, y3)
 *         cdef double maxy = max(y0, y1, y2, y3)
 */
  __pyx_t_9 = __pyx_v_x1;
  __pyx_t_5 = __pyx_v_x2;
  __pyx_t_6 = __pyx_v_x3;
  __pyx_t_7 = __pyx_v_x0;
  if (((__pyx_t_9 > __pyx_t_7) != 0)) {
    __pyx_t_8 = __pyx_t_9;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  __pyx_t_7 = __pyx_t_8;
  if (((__pyx_t_5 > __pyx_t_7) != 0)) {
    __pyx_t_8 = __pyx_t_5;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  __pyx_t_7 = __pyx_t_8;
  if (((__pyx_t_6 > __pyx_t_7) != 0)) {
    __pyx_t_8 = __pyx_t_6;
  } else {
    __pyx_t_8 = __pyx_t_7;
  }
  __pyx_v_maxx = __pyx_t_8;

  /* "renpy/display/render.pyx":1418
 *         cdef double minx = min(x0, x1, x2, x3)
 *         cdef double maxx = max(x0, x1, x2, x3)
 *         cdef double miny = min(y0, y1, y2, y3)             # <<<<<<<<<<<<<<
 *         cdef double maxy = max(y0, y1, y2, y3)
 * 
 */
  __pyx_t_8 = __pyx_v_y1;
  __pyx_t_9 = __pyx_v_y2;
  __pyx_t_5 = __pyx_v_y3;
  __pyx_t_6 = __pyx_v_y0;
  if (((__pyx_t_8 < __pyx_t_6) != 0)) {
    __pyx_t_7 = __pyx_t_8;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_t_6 = __pyx_t_7;
  if (((__pyx_t_9 < __pyx_t_6) != 0)) {
    __pyx_t_7 = __pyx_t_9;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_t_6 = __pyx_t_7;
  if (((__pyx_t_5 < __pyx_t_6) != 0)) {
    __pyx_t_7 = __pyx_t_5;
  } else {
    __pyx_t_7 = __pyx_t_6;
  }
  __pyx_v_miny = __pyx_t_7;

  /* "renpy/display/render.pyx":1419
 *         cdef double maxx = max(x0, x1, x2, x3)
 *         cdef double miny = min(y0, y1, y2, y3)
 *         cdef double maxy = max(y0, y1, y2, y3)             # <<<<<<<<<<<<<<
 * 
 *         return (
 */
  __pyx_t_7 = __pyx_v_y1;
  __pyx_t_8 = __pyx_v_y2;
  __pyx_t_9 = __pyx_v_y3;
  __pyx_t_5 = __pyx_v_y0;
  if (((__pyx_t_7 > __pyx_t_5) != 0)) {
    __pyx_t_6 = __pyx_t_7;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  __pyx_t_5 = __pyx_t_6;
  if (((__pyx_t_8 > __pyx_t_5) != 0)) {
    __pyx_t_6 = __pyx_t_8;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  __pyx_t_5 = __pyx_t_6;
  if (((__pyx_t_9 > __pyx_t_5) != 0)) {
    __pyx_t_6 = __pyx_t_9;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  __pyx_v_maxy = __pyx_t_6;

  /* "renpy/display/render.pyx":1421
 *         cdef double maxy = max(y0, y1, y2, y3)
 * 
 *         return (             # <<<<<<<<<<<<<<
 *             int(minx),
 *             int(miny),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "renpy/display/render.pyx":1422
 * 
 *         return (
 *             int(minx),             # <<<<<<<<<<<<<<
 *             int(miny),
 *             int(math.ceil(maxx - minx)),
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_minx); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

  /* "renpy/display/render.pyx":1423
 *         return (
 *             int(minx),
 *             int(miny),             # <<<<<<<<<<<<<<
 *             int(math.ceil(maxx - minx)),
 *             int(math.ceil(maxy - miny)),
 */
  __pyx_t_10 = PyFloat_FromDouble(__pyx_v_miny); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  __pyx_t_10 = 0;
  __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":1424
 *             int(minx),
 *             int(miny),
 *             int(math.ceil(maxx - minx)),             # <<<<<<<<<<<<<<
 *             int(math.ceil(maxy - miny)),
 *             )
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_ceil); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyFloat_FromDouble((__pyx_v_maxx - __pyx_v_minx)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_14 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_13))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_13);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_13, function);
    }
  }
  if (!__pyx_t_14) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_GOTREF(__pyx_t_11);
  } else {
    __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_15);
    PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
    PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_12);
    __Pyx_GIVEREF(__pyx_t_12);
    __pyx_t_12 = 0;
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  }
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  __pyx_t_13 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":1425
 *             int(miny),
 *             int(math.ceil(maxx - minx)),
 *             int(math.ceil(maxy - miny)),             # <<<<<<<<<<<<<<
 *             )
 * 
 */
  __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_math); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_ceil); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __pyx_t_15 = PyFloat_FromDouble((__pyx_v_maxy - __pyx_v_miny)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __pyx_t_14 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_12);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_12, function);
    }
  }
  if (!__pyx_t_14) {
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_15); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_GOTREF(__pyx_t_11);
  } else {
    __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_16);
    PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
    PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_15);
    __Pyx_GIVEREF(__pyx_t_15);
    __pyx_t_15 = 0;
    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = PyNumber_Int(__pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

  /* "renpy/display/render.pyx":1422
 * 
 *         return (
 *             int(minx),             # <<<<<<<<<<<<<<
 *             int(miny),
 *             int(math.ceil(maxx - minx)),
 */
  __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_12);
  __pyx_t_3 = 0;
  __pyx_t_10 = 0;
  __pyx_t_13 = 0;
  __pyx_t_12 = 0;
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1385
 *         return Canvas(surf)
 * 
 *     def screen_rect(self, double sx, double sy, Matrix transform):             # <<<<<<<<<<<<<<
 *         """
 *         Returns the rectangle, in screen-space coordinates, that will be covered
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("renpy.display.render.Render.screen_rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_transform);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1428
 *             )
 * 
 *     def place(self, d, x=0, y=0, width=None, height=None, st=None, at=None, render=None, main=True):             # <<<<<<<<<<<<<<
 *         """
 *         Documented in udd.rst.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_45place(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_44place[] = "\n        Documented in udd.rst.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_45place(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_d = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_v_st = 0;
  PyObject *__pyx_v_at = 0;
  PyObject *__pyx_v_render = 0;
  PyObject *__pyx_v_main = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("place (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_st,&__pyx_n_s_at,&__pyx_n_s_render,&__pyx_n_s_main,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)__pyx_int_0);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    values[5] = ((PyObject *)Py_None);
    values[6] = ((PyObject *)Py_None);
    values[7] = ((PyObject *)Py_None);
    values[8] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_height);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_st);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_at);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_render);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_main);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "place") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_d = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
    __pyx_v_width = values[3];
    __pyx_v_height = values[4];
    __pyx_v_st = values[5];
    __pyx_v_at = values[6];
    __pyx_v_render = values[7];
    __pyx_v_main = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("place", 0, 1, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1428; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.place", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_44place(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_d, __pyx_v_x, __pyx_v_y, __pyx_v_width, __pyx_v_height, __pyx_v_st, __pyx_v_at, __pyx_v_render, __pyx_v_main);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_44place(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_d, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_width, PyObject *__pyx_v_height, PyObject *__pyx_v_st, PyObject *__pyx_v_at, PyObject *__pyx_v_render, PyObject *__pyx_v_main) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("place", 0);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  __Pyx_INCREF(__pyx_v_st);
  __Pyx_INCREF(__pyx_v_at);
  __Pyx_INCREF(__pyx_v_render);

  /* "renpy/display/render.pyx":1433
 *         """
 * 
 *         if width is None:             # <<<<<<<<<<<<<<
 *             width = self.width
 *         if height is None:
 */
  __pyx_t_1 = (__pyx_v_width == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1434
 * 
 *         if width is None:
 *             width = self.width             # <<<<<<<<<<<<<<
 *         if height is None:
 *             height = self.height
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_width, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1435
 *         if width is None:
 *             width = self.width
 *         if height is None:             # <<<<<<<<<<<<<<
 *             height = self.height
 * 
 */
  __pyx_t_2 = (__pyx_v_height == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "renpy/display/render.pyx":1436
 *             width = self.width
 *         if height is None:
 *             height = self.height             # <<<<<<<<<<<<<<
 * 
 *         if render is None:
 */
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_height, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":1438
 *             height = self.height
 * 
 *         if render is None:             # <<<<<<<<<<<<<<
 *             if st is None:
 *                 st = render_st
 */
  __pyx_t_1 = (__pyx_v_render == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1439
 * 
 *         if render is None:
 *             if st is None:             # <<<<<<<<<<<<<<
 *                 st = render_st
 *             if at is None:
 */
    __pyx_t_2 = (__pyx_v_st == Py_None);
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "renpy/display/render.pyx":1440
 *         if render is None:
 *             if st is None:
 *                 st = render_st             # <<<<<<<<<<<<<<
 *             if at is None:
 *                 at = render_at
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_st); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_st, __pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "renpy/display/render.pyx":1441
 *             if st is None:
 *                 st = render_st
 *             if at is None:             # <<<<<<<<<<<<<<
 *                 at = render_at
 * 
 */
    __pyx_t_1 = (__pyx_v_at == Py_None);
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "renpy/display/render.pyx":1442
 *                 st = render_st
 *             if at is None:
 *                 at = render_at             # <<<<<<<<<<<<<<
 * 
 *             render = renpy.display.render.render(d, width, height, st, at)
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_render_at); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_at, __pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "renpy/display/render.pyx":1444
 *                 at = render_at
 * 
 *             render = renpy.display.render.render(d, width, height, st, at)             # <<<<<<<<<<<<<<
 * 
 *         d.place(self, x, y, width, height, render, main=main)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_display); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_render); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_render); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_4) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_d);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_d);
    __Pyx_GIVEREF(__pyx_v_d);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __Pyx_INCREF(__pyx_v_height);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_height);
    __Pyx_GIVEREF(__pyx_v_height);
    __Pyx_INCREF(__pyx_v_st);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_st);
    __Pyx_GIVEREF(__pyx_v_st);
    __Pyx_INCREF(__pyx_v_at);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, __pyx_v_at);
    __Pyx_GIVEREF(__pyx_v_at);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_render, __pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "renpy/display/render.pyx":1446
 *             render = renpy.display.render.render(d, width, height, st, at)
 * 
 *         d.place(self, x, y, width, height, render, main=main)             # <<<<<<<<<<<<<<
 * 
 *     def zoom(self, xzoom, yzoom):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_place); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  __Pyx_INCREF(__pyx_v_y);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_y);
  __Pyx_GIVEREF(__pyx_v_y);
  __Pyx_INCREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  __Pyx_INCREF(__pyx_v_height);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_height);
  __Pyx_GIVEREF(__pyx_v_height);
  __Pyx_INCREF(__pyx_v_render);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_render);
  __Pyx_GIVEREF(__pyx_v_render);
  __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_main, __pyx_v_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "renpy/display/render.pyx":1428
 *             )
 * 
 *     def place(self, d, x=0, y=0, width=None, height=None, st=None, at=None, render=None, main=True):             # <<<<<<<<<<<<<<
 *         """
 *         Documented in udd.rst.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Render.place", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_st);
  __Pyx_XDECREF(__pyx_v_at);
  __Pyx_XDECREF(__pyx_v_render);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1448
 *         d.place(self, x, y, width, height, render, main=main)
 * 
 *     def zoom(self, xzoom, yzoom):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the zoom factor applied to this displayable's children.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_47zoom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5renpy_7display_6render_6Render_46zoom[] = "\n        Sets the zoom factor applied to this displayable's children.\n        ";
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_47zoom(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_xzoom = 0;
  PyObject *__pyx_v_yzoom = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zoom (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xzoom,&__pyx_n_s_yzoom,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xzoom)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yzoom)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zoom") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_xzoom = values[0];
    __pyx_v_yzoom = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_46zoom(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), __pyx_v_xzoom, __pyx_v_yzoom);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_46zoom(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_xzoom, PyObject *__pyx_v_yzoom) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zoom", 0);

  /* "renpy/display/render.pyx":1452
 *         Sets the zoom factor applied to this displayable's children.
 *         """
 *         if self.reverse is None:             # <<<<<<<<<<<<<<
 *             self.reverse = IDENTITY
 *             self.forward = IDENTITY
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_self->reverse) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1453
 *         """
 *         if self.reverse is None:
 *             self.reverse = IDENTITY             # <<<<<<<<<<<<<<
 *             self.forward = IDENTITY
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IDENTITY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->reverse);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->reverse));
    __pyx_v_self->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "renpy/display/render.pyx":1454
 *         if self.reverse is None:
 *             self.reverse = IDENTITY
 *             self.forward = IDENTITY             # <<<<<<<<<<<<<<
 * 
 *         self.reverse *= Matrix2D(xzoom, 0, 0, yzoom)
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_IDENTITY); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->forward);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
    __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "renpy/display/render.pyx":1456
 *             self.forward = IDENTITY
 * 
 *         self.reverse *= Matrix2D(xzoom, 0, 0, yzoom)             # <<<<<<<<<<<<<<
 * 
 *         if xzoom and yzoom:
 */
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_xzoom);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xzoom);
  __Pyx_GIVEREF(__pyx_v_xzoom);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  __Pyx_INCREF(__pyx_v_yzoom);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_yzoom);
  __Pyx_GIVEREF(__pyx_v_yzoom);
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix2D)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->reverse), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->reverse);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->reverse));
  __pyx_v_self->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1458
 *         self.reverse *= Matrix2D(xzoom, 0, 0, yzoom)
 * 
 *         if xzoom and yzoom:             # <<<<<<<<<<<<<<
 *             self.forward *= Matrix2D(1.0 / xzoom, 0, 0, 1.0 / yzoom)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_xzoom); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {
  } else {
    __pyx_t_2 = __pyx_t_1;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_yzoom); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "renpy/display/render.pyx":1459
 * 
 *         if xzoom and yzoom:
 *             self.forward *= Matrix2D(1.0 / xzoom, 0, 0, 1.0 / yzoom)             # <<<<<<<<<<<<<<
 *         else:
 *             self.forward *= Matrix2D(0, 0, 0, 0)
 */
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_float_1_0, __pyx_v_xzoom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_float_1_0, __pyx_v_yzoom); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    __Pyx_INCREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix2D)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->forward), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->forward);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
    __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_5);
    __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "renpy/display/render.pyx":1461
 *             self.forward *= Matrix2D(1.0 / xzoom, 0, 0, 1.0 / yzoom)
 *         else:
 *             self.forward *= Matrix2D(0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * 
 * class Canvas(object):
 */
    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix2D)), __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = PyNumber_InPlaceMultiply(((PyObject *)__pyx_v_self->forward), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->forward);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
    __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L4:;

  /* "renpy/display/render.pyx":1448
 *         d.place(self, x, y, width, height, render, main=main)
 * 
 *     def zoom(self, xzoom, yzoom):             # <<<<<<<<<<<<<<
 *         """
 *         Sets the zoom factor applied to this displayable's children.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("renpy.display.render.Render.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":27
 * cdef class Render:
 * 
 *     cdef public bint mark, cache_killed             # <<<<<<<<<<<<<<
 * 
 *     cdef public float width, height
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4mark_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4mark_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4mark___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4mark___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->mark); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.mark.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_4mark_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_4mark_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4mark_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_4mark_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->mark = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.mark.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12cache_killed_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12cache_killed_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12cache_killed___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12cache_killed___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->cache_killed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.cache_killed.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12cache_killed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12cache_killed_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12cache_killed_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12cache_killed_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->cache_killed = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.cache_killed.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":29
 *     cdef public bint mark, cache_killed
 * 
 *     cdef public float width, height             # <<<<<<<<<<<<<<
 *     cdef public object layer_name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5width_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5width___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5width___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5width_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_5width_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->width = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6height_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6height_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6height___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6height___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6height_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_6height_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->height = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":30
 * 
 *     cdef public float width, height
 *     cdef public object layer_name             # <<<<<<<<<<<<<<
 * 
 *     cdef public list children
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10layer_name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10layer_name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10layer_name___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10layer_name___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->layer_name);
  __pyx_r = __pyx_v_self->layer_name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10layer_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10layer_name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10layer_name_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10layer_name_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->layer_name);
  __Pyx_DECREF(__pyx_v_self->layer_name);
  __pyx_v_self->layer_name = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10layer_name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10layer_name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10layer_name_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10layer_name_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->layer_name);
  __Pyx_DECREF(__pyx_v_self->layer_name);
  __pyx_v_self->layer_name = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":32
 *     cdef public object layer_name
 * 
 *     cdef public list children             # <<<<<<<<<<<<<<
 *     cdef public set parents
 *     cdef public list depends_on_list
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_8children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_8children_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8children___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8children___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->children);
  __pyx_r = __pyx_v_self->children;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_8children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8children_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_8children_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->children);
  __Pyx_DECREF(__pyx_v_self->children);
  __pyx_v_self->children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.children.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_8children_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_8children_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8children_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_8children_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->children);
  __Pyx_DECREF(__pyx_v_self->children);
  __pyx_v_self->children = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":33
 * 
 *     cdef public list children
 *     cdef public set parents             # <<<<<<<<<<<<<<
 *     cdef public list depends_on_list
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7parents_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7parents_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7parents___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7parents___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parents);
  __pyx_r = __pyx_v_self->parents;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7parents_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7parents_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7parents_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7parents_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PySet_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "set", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->parents);
  __Pyx_DECREF(__pyx_v_self->parents);
  __pyx_v_self->parents = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.parents.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7parents_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7parents_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7parents_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7parents_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->parents);
  __Pyx_DECREF(__pyx_v_self->parents);
  __pyx_v_self->parents = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":34
 *     cdef public list children
 *     cdef public set parents
 *     cdef public list depends_on_list             # <<<<<<<<<<<<<<
 * 
 *     # gl, sw: The drawing operation and its parameters.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_15depends_on_list___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->depends_on_list);
  __pyx_r = __pyx_v_self->depends_on_list;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->depends_on_list);
  __Pyx_DECREF(__pyx_v_self->depends_on_list);
  __pyx_v_self->depends_on_list = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.depends_on_list.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_15depends_on_list_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->depends_on_list);
  __Pyx_DECREF(__pyx_v_self->depends_on_list);
  __pyx_v_self->depends_on_list = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":37
 * 
 *     # gl, sw: The drawing operation and its parameters.
 *     cdef public int operation             # <<<<<<<<<<<<<<
 *     cdef public double operation_complete
 *     cdef public bint operation_alpha
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9operation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9operation_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9operation___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9operation___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->operation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.operation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9operation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9operation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9operation_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9operation_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->operation = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.operation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":38
 *     # gl, sw: The drawing operation and its parameters.
 *     cdef public int operation
 *     cdef public double operation_complete             # <<<<<<<<<<<<<<
 *     cdef public bint operation_alpha
 *     cdef public object operation_parameter
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_18operation_complete_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_18operation_complete_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_18operation_complete___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_18operation_complete___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->operation_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.operation_complete.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_18operation_complete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_18operation_complete_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_18operation_complete_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_18operation_complete_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->operation_complete = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.operation_complete.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":39
 *     cdef public int operation
 *     cdef public double operation_complete
 *     cdef public bint operation_alpha             # <<<<<<<<<<<<<<
 *     cdef public object operation_parameter
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_15operation_alpha___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_15operation_alpha___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->operation_alpha); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.operation_alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_15operation_alpha_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_15operation_alpha_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->operation_alpha = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.operation_alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":40
 *     cdef public double operation_complete
 *     cdef public bint operation_alpha
 *     cdef public object operation_parameter             # <<<<<<<<<<<<<<
 * 
 *     # The transform toward texture space
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_19operation_parameter___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->operation_parameter);
  __pyx_r = __pyx_v_self->operation_parameter;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->operation_parameter);
  __Pyx_DECREF(__pyx_v_self->operation_parameter);
  __pyx_v_self->operation_parameter = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_19operation_parameter_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->operation_parameter);
  __Pyx_DECREF(__pyx_v_self->operation_parameter);
  __pyx_v_self->operation_parameter = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":43
 * 
 *     # The transform toward texture space
 *     cdef public Matrix forward             # <<<<<<<<<<<<<<
 * 
 *     # The transform toward screen space.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7forward_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7forward_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7forward___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7forward___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->forward));
  __pyx_r = ((PyObject *)__pyx_v_self->forward);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7forward_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7forward_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7forward_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7forward_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->forward);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
  __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.forward.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7forward_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7forward_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7forward_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7forward_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->forward);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->forward));
  __pyx_v_self->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":46
 * 
 *     # The transform toward screen space.
 *     cdef public Matrix reverse             # <<<<<<<<<<<<<<
 * 
 *     # Alpha multiplication - this is multipled with r, g, b, and a, to reduce
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7reverse_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7reverse_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7reverse___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7reverse___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->reverse));
  __pyx_r = ((PyObject *)__pyx_v_self->reverse);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7reverse_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7reverse_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7reverse_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5renpy_7display_6matrix_Matrix))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->reverse);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->reverse));
  __pyx_v_self->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.reverse.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7reverse_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7reverse_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7reverse_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7reverse_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->reverse);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->reverse));
  __pyx_v_self->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":50
 *     # Alpha multiplication - this is multipled with r, g, b, and a, to reduce
 *     # the alpha of this Render and its children.
 *     cdef public double alpha             # <<<<<<<<<<<<<<
 * 
 *     # Over multiplication - this is multiplied with a. This is really (1-additive),
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5alpha_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5alpha_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5alpha___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5alpha___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->alpha); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_5alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5alpha_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_5alpha_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->alpha = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":54
 *     # Over multiplication - this is multiplied with a. This is really (1-additive),
 *     # such that if this is 0.0, additive blending occurs.
 *     cdef public double over             # <<<<<<<<<<<<<<
 * 
 *     # True if child textures should be rendered in nearest-neighbor mode.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4over_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4over_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4over___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4over___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->over); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.over.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_4over_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_4over_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4over_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_4over_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->over = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.over.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":57
 * 
 *     # True if child textures should be rendered in nearest-neighbor mode.
 *     cdef public object nearest             # <<<<<<<<<<<<<<
 * 
 *     cdef public list focuses
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7nearest_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7nearest_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7nearest___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7nearest___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->nearest);
  __pyx_r = __pyx_v_self->nearest;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7nearest_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7nearest_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7nearest_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7nearest_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->nearest);
  __Pyx_DECREF(__pyx_v_self->nearest);
  __pyx_v_self->nearest = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7nearest_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7nearest_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7nearest_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7nearest_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->nearest);
  __Pyx_DECREF(__pyx_v_self->nearest);
  __pyx_v_self->nearest = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":59
 *     cdef public object nearest
 * 
 *     cdef public list focuses             # <<<<<<<<<<<<<<
 *     cdef public list pass_focuses
 *     cdef public object focus_screen
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7focuses_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7focuses_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7focuses___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7focuses___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->focuses);
  __pyx_r = __pyx_v_self->focuses;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7focuses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7focuses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7focuses_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7focuses_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->focuses);
  __Pyx_DECREF(__pyx_v_self->focuses);
  __pyx_v_self->focuses = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.focuses.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7focuses_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7focuses_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7focuses_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7focuses_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->focuses);
  __Pyx_DECREF(__pyx_v_self->focuses);
  __pyx_v_self->focuses = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":60
 * 
 *     cdef public list focuses
 *     cdef public list pass_focuses             # <<<<<<<<<<<<<<
 *     cdef public object focus_screen
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12pass_focuses___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->pass_focuses);
  __pyx_r = __pyx_v_self->pass_focuses;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->pass_focuses);
  __Pyx_DECREF(__pyx_v_self->pass_focuses);
  __pyx_v_self->pass_focuses = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.pass_focuses.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12pass_focuses_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->pass_focuses);
  __Pyx_DECREF(__pyx_v_self->pass_focuses);
  __pyx_v_self->pass_focuses = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":61
 *     cdef public list focuses
 *     cdef public list pass_focuses
 *     cdef public object focus_screen             # <<<<<<<<<<<<<<
 * 
 *     cdef public object draw_func
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12focus_screen_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12focus_screen_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12focus_screen___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12focus_screen___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->focus_screen);
  __pyx_r = __pyx_v_self->focus_screen;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->focus_screen);
  __Pyx_DECREF(__pyx_v_self->focus_screen);
  __pyx_v_self->focus_screen = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12focus_screen_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->focus_screen);
  __Pyx_DECREF(__pyx_v_self->focus_screen);
  __pyx_v_self->focus_screen = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":63
 *     cdef public object focus_screen
 * 
 *     cdef public object draw_func             # <<<<<<<<<<<<<<
 *     cdef public object render_of
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9draw_func_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9draw_func_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9draw_func___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9draw_func___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->draw_func);
  __pyx_r = __pyx_v_self->draw_func;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9draw_func_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9draw_func_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9draw_func_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9draw_func_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->draw_func);
  __Pyx_DECREF(__pyx_v_self->draw_func);
  __pyx_v_self->draw_func = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9draw_func_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9draw_func_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9draw_func_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9draw_func_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->draw_func);
  __Pyx_DECREF(__pyx_v_self->draw_func);
  __pyx_v_self->draw_func = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":64
 * 
 *     cdef public object draw_func
 *     cdef public object render_of             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint opaque
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9render_of_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9render_of_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9render_of___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9render_of___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->render_of);
  __pyx_r = __pyx_v_self->render_of;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9render_of_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9render_of_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9render_of_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9render_of_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->render_of);
  __Pyx_DECREF(__pyx_v_self->render_of);
  __pyx_v_self->render_of = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9render_of_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9render_of_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9render_of_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9render_of_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->render_of);
  __Pyx_DECREF(__pyx_v_self->render_of);
  __pyx_v_self->render_of = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":66
 *     cdef public object render_of
 * 
 *     cdef public bint opaque             # <<<<<<<<<<<<<<
 *     cdef public list visible_children
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6opaque_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6opaque_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6opaque___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6opaque___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->opaque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.opaque.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_6opaque_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_6opaque_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6opaque_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_6opaque_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->opaque = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.opaque.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":67
 * 
 *     cdef public bint opaque
 *     cdef public list visible_children             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint xclipping
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_16visible_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_16visible_children_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_16visible_children___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_16visible_children___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->visible_children);
  __pyx_r = __pyx_v_self->visible_children;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_16visible_children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_16visible_children_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_16visible_children_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_16visible_children_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->visible_children);
  __Pyx_DECREF(__pyx_v_self->visible_children);
  __pyx_v_self->visible_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.visible_children.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_16visible_children_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_16visible_children_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_16visible_children_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_16visible_children_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->visible_children);
  __Pyx_DECREF(__pyx_v_self->visible_children);
  __pyx_v_self->visible_children = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":69
 *     cdef public list visible_children
 * 
 *     cdef public bint xclipping             # <<<<<<<<<<<<<<
 *     cdef public bint yclipping
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9xclipping_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9xclipping_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9xclipping___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9xclipping___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->xclipping); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.xclipping.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9xclipping_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9xclipping_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9xclipping_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9xclipping_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->xclipping = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.xclipping.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":70
 * 
 *     cdef public bint xclipping
 *     cdef public bint yclipping             # <<<<<<<<<<<<<<
 * 
 *     # gl, sw: Caching of render-to-texture.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9yclipping_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_9yclipping_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9yclipping___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_9yclipping___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->yclipping); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.yclipping.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_9yclipping_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_9yclipping_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_9yclipping_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_9yclipping_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->yclipping = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.yclipping.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":73
 * 
 *     # gl, sw: Caching of render-to-texture.
 *     cdef public object surface, alpha_surface, half_cache             # <<<<<<<<<<<<<<
 * 
 *     cdef public bint modal
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7surface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7surface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7surface___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7surface___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->surface);
  __pyx_r = __pyx_v_self->surface;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7surface_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7surface_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->surface);
  __Pyx_DECREF(__pyx_v_self->surface);
  __pyx_v_self->surface = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7surface_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7surface_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7surface_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7surface_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->surface);
  __Pyx_DECREF(__pyx_v_self->surface);
  __pyx_v_self->surface = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_13alpha_surface___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->alpha_surface);
  __pyx_r = __pyx_v_self->alpha_surface;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->alpha_surface);
  __Pyx_DECREF(__pyx_v_self->alpha_surface);
  __pyx_v_self->alpha_surface = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_13alpha_surface_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->alpha_surface);
  __Pyx_DECREF(__pyx_v_self->alpha_surface);
  __pyx_v_self->alpha_surface = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10half_cache_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10half_cache_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10half_cache___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10half_cache___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->half_cache);
  __pyx_r = __pyx_v_self->half_cache;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10half_cache_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10half_cache_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10half_cache_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10half_cache_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->half_cache);
  __Pyx_DECREF(__pyx_v_self->half_cache);
  __pyx_v_self->half_cache = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10half_cache_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10half_cache_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10half_cache_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10half_cache_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->half_cache);
  __Pyx_DECREF(__pyx_v_self->half_cache);
  __pyx_v_self->half_cache = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":75
 *     cdef public object surface, alpha_surface, half_cache
 * 
 *     cdef public bint modal             # <<<<<<<<<<<<<<
 *     cdef public bint text_input
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5modal_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_5modal_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5modal___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_5modal___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->modal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.modal.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_5modal_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_5modal_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_5modal_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_5modal_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->modal = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.modal.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":76
 * 
 *     cdef public bint modal
 *     cdef public bint text_input             # <<<<<<<<<<<<<<
 * 
 *     # gl2 ######################################################################
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10text_input_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10text_input_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10text_input___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10text_input___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->text_input); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.text_input.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10text_input_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10text_input_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10text_input_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10text_input_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->text_input = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.text_input.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":83
 *     # and used to form a model. If this is True, the Mesh is taken from the first
 *     # child's Texture, otherwise this must be a Mesh.
 *     cdef public object mesh             # <<<<<<<<<<<<<<
 * 
 *     # A tuple of shaders that will be used when rendering, or None.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4mesh_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_4mesh_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4mesh___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_4mesh___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->mesh);
  __pyx_r = __pyx_v_self->mesh;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_4mesh_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_4mesh_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4mesh_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_4mesh_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_4mesh_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_4mesh_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_4mesh_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_4mesh_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":86
 * 
 *     # A tuple of shaders that will be used when rendering, or None.
 *     cdef public tuple shaders             # <<<<<<<<<<<<<<
 * 
 *     # A dictionary containing uniforms that will be used when rendering, or
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7shaders_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_7shaders_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7shaders___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_7shaders___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->shaders);
  __pyx_r = __pyx_v_self->shaders;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7shaders_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7shaders_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7shaders_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7shaders_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->shaders);
  __Pyx_DECREF(__pyx_v_self->shaders);
  __pyx_v_self->shaders = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.shaders.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_7shaders_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_7shaders_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_7shaders_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_7shaders_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->shaders);
  __Pyx_DECREF(__pyx_v_self->shaders);
  __pyx_v_self->shaders = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":90
 *     # A dictionary containing uniforms that will be used when rendering, or
 *     # None.
 *     cdef public dict uniforms             # <<<<<<<<<<<<<<
 * 
 *     # Properties that control rendering.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_8uniforms_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_8uniforms_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8uniforms___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_8uniforms___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->uniforms);
  __pyx_r = __pyx_v_self->uniforms;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_8uniforms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_8uniforms_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8uniforms_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_8uniforms_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->uniforms);
  __Pyx_DECREF(__pyx_v_self->uniforms);
  __pyx_v_self->uniforms = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.uniforms.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_8uniforms_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_8uniforms_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_8uniforms_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_8uniforms_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->uniforms);
  __Pyx_DECREF(__pyx_v_self->uniforms);
  __pyx_v_self->uniforms = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":93
 * 
 *     # Properties that control rendering.
 *     cdef public dict properties             # <<<<<<<<<<<<<<
 * 
 *     # Used to cache the result of rendering this Render to a texture.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10properties_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_10properties_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10properties___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_10properties___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->properties);
  __pyx_r = __pyx_v_self->properties;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10properties_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10properties_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10properties_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10properties_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->properties);
  __Pyx_DECREF(__pyx_v_self->properties);
  __pyx_v_self->properties = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.properties.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_10properties_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_10properties_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_10properties_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_10properties_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->properties);
  __Pyx_DECREF(__pyx_v_self->properties);
  __pyx_v_self->properties = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":96
 * 
 *     # Used to cache the result of rendering this Render to a texture.
 *     cdef public object cached_texture             # <<<<<<<<<<<<<<
 * 
 *     # Used to cache the model.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_14cached_texture_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_14cached_texture_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_14cached_texture___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_14cached_texture___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->cached_texture);
  __pyx_r = __pyx_v_self->cached_texture;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->cached_texture);
  __Pyx_DECREF(__pyx_v_self->cached_texture);
  __pyx_v_self->cached_texture = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_14cached_texture_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cached_texture);
  __Pyx_DECREF(__pyx_v_self->cached_texture);
  __pyx_v_self->cached_texture = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":99
 * 
 *     # Used to cache the model.
 *     cdef public object cached_model             # <<<<<<<<<<<<<<
 * 
 *     # True if the texture has been loaded.
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12cached_model_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_12cached_model_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12cached_model___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_12cached_model___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->cached_model);
  __pyx_r = __pyx_v_self->cached_model;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12cached_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12cached_model_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12cached_model_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12cached_model_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->cached_model);
  __Pyx_DECREF(__pyx_v_self->cached_model);
  __pyx_v_self->cached_model = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_12cached_model_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_12cached_model_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_12cached_model_4__del__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_12cached_model_4__del__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->cached_model);
  __Pyx_DECREF(__pyx_v_self->cached_model);
  __pyx_v_self->cached_model = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pxd":102
 * 
 *     # True if the texture has been loaded.
 *     cdef public bint loaded             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6loaded_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5renpy_7display_6render_6Render_6loaded_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6loaded___get__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Render_6loaded___get__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->loaded); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Render.loaded.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_5renpy_7display_6render_6Render_6loaded_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5renpy_7display_6render_6Render_6loaded_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Render_6loaded_2__set__(((struct __pyx_obj_5renpy_7display_6render_Render *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_5renpy_7display_6render_6Render_6loaded_2__set__(struct __pyx_obj_5renpy_7display_6render_Render *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->loaded = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Render.loaded.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1465
 * class Canvas(object):
 * 
 *     def __init__(self, surf): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         self.surf = surf
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_surf = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_surf,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_surf)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_surf = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas___init__(__pyx_self, __pyx_v_self, __pyx_v_surf);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_surf) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "renpy/display/render.pyx":1466
 * 
 *     def __init__(self, surf): #@DuplicatedSignature
 *         self.surf = surf             # <<<<<<<<<<<<<<
 * 
 *     def rect(self, color, rect, width=0):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_surf, __pyx_v_surf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":1465
 * class Canvas(object):
 * 
 *     def __init__(self, surf): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         self.surf = surf
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1468
 *         self.surf = surf
 * 
 *     def rect(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_3rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_3rect = {"rect", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_3rect, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_3rect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_rect = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rect (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rect") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_rect = values[2];
    __pyx_v_width = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rect", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_2rect(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_rect, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rect", 0);

  /* "renpy/display/render.pyx":1470
 *     def rect(self, color, rect, width=0):
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.rect(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1471
 * 
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.rect(self.surf,
 *                              renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1472
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.rect(self.surf,             # <<<<<<<<<<<<<<
 *                              renpy.easy.color(color),
 *                              rect,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_rect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1473
 *             blit_lock.acquire()
 *             pygame.draw.rect(self.surf,
 *                              renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                              rect,
 *                              width)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1475
 *                              renpy.easy.color(color),
 *                              rect,
 *                              width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_rect);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_rect);
    __Pyx_GIVEREF(__pyx_v_rect);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1477
 *                              width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def polygon(self, color, pointlist, width=0):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1468
 *         self.surf = surf
 * 
 *     def rect(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1479
 *             blit_lock.release()
 * 
 *     def polygon(self, color, pointlist, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_5polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_5polygon = {"polygon", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_5polygon, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_5polygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_pointlist = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("polygon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_pointlist,&__pyx_n_s_width,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_pointlist = values[2];
    __pyx_v_width = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("polygon", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_4polygon(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_pointlist, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_4polygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("polygon", 0);

  /* "renpy/display/render.pyx":1480
 * 
 *     def polygon(self, color, pointlist, width=0):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.polygon(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1481
 *     def polygon(self, color, pointlist, width=0):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.polygon(self.surf,
 *                                 renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1482
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.polygon(self.surf,             # <<<<<<<<<<<<<<
 *                                 renpy.easy.color(color),
 *                                 pointlist,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_polygon); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1483
 *             blit_lock.acquire()
 *             pygame.draw.polygon(self.surf,
 *                                 renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                                 pointlist,
 *                                 width)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1485
 *                                 renpy.easy.color(color),
 *                                 pointlist,
 *                                 width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_pointlist);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_pointlist);
    __Pyx_GIVEREF(__pyx_v_pointlist);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1487
 *                                 width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def circle(self, color, pos, radius, width=0):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1479
 *             blit_lock.release()
 * 
 *     def polygon(self, color, pointlist, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.polygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1489
 *             blit_lock.release()
 * 
 *     def circle(self, color, pos, radius, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_7circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_7circle = {"circle", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_7circle, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_7circle(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_pos = 0;
  PyObject *__pyx_v_radius = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("circle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_pos,&__pyx_n_s_radius,&__pyx_n_s_width,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_pos = values[2];
    __pyx_v_radius = values[3];
    __pyx_v_width = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("circle", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_6circle(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_pos, __pyx_v_radius, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_6circle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_pos, PyObject *__pyx_v_radius, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("circle", 0);

  /* "renpy/display/render.pyx":1491
 *     def circle(self, color, pos, radius, width=0):
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.circle(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1492
 * 
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.circle(self.surf,
 *                                renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1493
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.circle(self.surf,             # <<<<<<<<<<<<<<
 *                                renpy.easy.color(color),
 *                                pos,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_circle); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1494
 *             blit_lock.acquire()
 *             pygame.draw.circle(self.surf,
 *                                renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                                pos,
 *                                radius,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1497
 *                                pos,
 *                                radius,
 *                                width)             # <<<<<<<<<<<<<<
 * 
 *         finally:
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_pos);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_pos);
    __Pyx_GIVEREF(__pyx_v_pos);
    __Pyx_INCREF(__pyx_v_radius);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_radius);
    __Pyx_GIVEREF(__pyx_v_radius);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1500
 * 
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def ellipse(self, color, rect, width=0):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1489
 *             blit_lock.release()
 * 
 *     def circle(self, color, pos, radius, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.circle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1502
 *             blit_lock.release()
 * 
 *     def ellipse(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_9ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_9ellipse = {"ellipse", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_9ellipse, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_9ellipse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_rect = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ellipse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_width,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)__pyx_int_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "ellipse") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_rect = values[2];
    __pyx_v_width = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("ellipse", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_8ellipse(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_rect, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_8ellipse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ellipse", 0);

  /* "renpy/display/render.pyx":1503
 * 
 *     def ellipse(self, color, rect, width=0):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.ellipse(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1504
 *     def ellipse(self, color, rect, width=0):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.ellipse(self.surf,
 *                                 renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1505
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.ellipse(self.surf,             # <<<<<<<<<<<<<<
 *                                 renpy.easy.color(color),
 *                                 rect,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ellipse); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1506
 *             blit_lock.acquire()
 *             pygame.draw.ellipse(self.surf,
 *                                 renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                                 rect,
 *                                 width)
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1508
 *                                 renpy.easy.color(color),
 *                                 rect,
 *                                 width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_rect);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_rect);
    __Pyx_GIVEREF(__pyx_v_rect);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1510
 *                                 width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1502
 *             blit_lock.release()
 * 
 *     def ellipse(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.ellipse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1513
 * 
 * 
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_11arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_11arc = {"arc", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_11arc, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_11arc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_rect = 0;
  PyObject *__pyx_v_start_angle = 0;
  PyObject *__pyx_v_stop_angle = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_rect,&__pyx_n_s_start_angle,&__pyx_n_s_stop_angle,&__pyx_n_s_width,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[5] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rect)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_angle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop_angle)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arc") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_rect = values[2];
    __pyx_v_start_angle = values[3];
    __pyx_v_stop_angle = values[4];
    __pyx_v_width = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arc", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_10arc(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_rect, __pyx_v_start_angle, __pyx_v_stop_angle, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_10arc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_rect, PyObject *__pyx_v_start_angle, PyObject *__pyx_v_stop_angle, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc", 0);

  /* "renpy/display/render.pyx":1514
 * 
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.arc(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1515
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.arc(self.surf,
 *                             renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1516
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.arc(self.surf,             # <<<<<<<<<<<<<<
 *                             renpy.easy.color(color),
 *                             rect,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_arc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1517
 *             blit_lock.acquire()
 *             pygame.draw.arc(self.surf,
 *                             renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                             rect,
 *                             start_angle,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1521
 *                             start_angle,
 *                             stop_angle,
 *                             width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(6+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_rect);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_rect);
    __Pyx_GIVEREF(__pyx_v_rect);
    __Pyx_INCREF(__pyx_v_start_angle);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_start_angle);
    __Pyx_GIVEREF(__pyx_v_start_angle);
    __Pyx_INCREF(__pyx_v_stop_angle);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_stop_angle);
    __Pyx_GIVEREF(__pyx_v_stop_angle);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 5+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1523
 *                             width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1513
 * 
 * 
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.arc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1526
 * 
 * 
 *     def line(self, color, start_pos, end_pos, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_13line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_13line = {"line", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_13line, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_13line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_start_pos = 0;
  PyObject *__pyx_v_end_pos = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("line (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_start_pos,&__pyx_n_s_end_pos,&__pyx_n_s_width,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_pos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_start_pos = values[2];
    __pyx_v_end_pos = values[3];
    __pyx_v_width = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("line", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.line", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_12line(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_start_pos, __pyx_v_end_pos, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_12line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_start_pos, PyObject *__pyx_v_end_pos, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("line", 0);

  /* "renpy/display/render.pyx":1527
 * 
 *     def line(self, color, start_pos, end_pos, width=1):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.line(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1528
 *     def line(self, color, start_pos, end_pos, width=1):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.line(self.surf,
 *                              renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1529
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.line(self.surf,             # <<<<<<<<<<<<<<
 *                              renpy.easy.color(color),
 *                              start_pos,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1530
 *             blit_lock.acquire()
 *             pygame.draw.line(self.surf,
 *                              renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                              start_pos,
 *                              end_pos,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1530; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1533
 *                              start_pos,
 *                              end_pos,
 *                              width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_start_pos);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_start_pos);
    __Pyx_GIVEREF(__pyx_v_start_pos);
    __Pyx_INCREF(__pyx_v_end_pos);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_end_pos);
    __Pyx_GIVEREF(__pyx_v_end_pos);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1529; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1535
 *                              width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def lines(self, color, closed, pointlist, width=1):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1526
 * 
 * 
 *     def line(self, color, start_pos, end_pos, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.line", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1537
 *             blit_lock.release()
 * 
 *     def lines(self, color, closed, pointlist, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_15lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_15lines = {"lines", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_15lines, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_15lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_closed = 0;
  PyObject *__pyx_v_pointlist = 0;
  PyObject *__pyx_v_width = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_width,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_closed = values[2];
    __pyx_v_pointlist = values[3];
    __pyx_v_width = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("lines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.lines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_14lines(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_width);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_14lines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_width) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lines", 0);

  /* "renpy/display/render.pyx":1538
 * 
 *     def lines(self, color, closed, pointlist, width=1):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.lines(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1539
 *     def lines(self, color, closed, pointlist, width=1):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.lines(self.surf,
 *                               renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1540
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.lines(self.surf,             # <<<<<<<<<<<<<<
 *                               renpy.easy.color(color),
 *                               closed,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lines); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1541
 *             blit_lock.acquire()
 *             pygame.draw.lines(self.surf,
 *                               renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                               closed,
 *                               pointlist,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1544
 *                               closed,
 *                               pointlist,
 *                               width)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_closed);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_closed);
    __Pyx_GIVEREF(__pyx_v_closed);
    __Pyx_INCREF(__pyx_v_pointlist);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_pointlist);
    __Pyx_GIVEREF(__pyx_v_pointlist);
    __Pyx_INCREF(__pyx_v_width);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_width);
    __Pyx_GIVEREF(__pyx_v_width);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1546
 *                               width)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1537
 *             blit_lock.release()
 * 
 *     def lines(self, color, closed, pointlist, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.lines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1548
 *             blit_lock.release()
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_17aaline = {"aaline", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_17aaline, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_17aaline(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_startpos = 0;
  PyObject *__pyx_v_endpos = 0;
  PyObject *__pyx_v_blend = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("aaline (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_startpos,&__pyx_n_s_endpos,&__pyx_n_s_blend,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_startpos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_endpos)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aaline") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_startpos = values[2];
    __pyx_v_endpos = values[3];
    __pyx_v_blend = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("aaline", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_16aaline(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_startpos, __pyx_v_endpos, __pyx_v_blend);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_16aaline(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_startpos, PyObject *__pyx_v_endpos, PyObject *__pyx_v_blend) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("aaline", 0);

  /* "renpy/display/render.pyx":1549
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.aaline(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1550
 *     def aaline(self, color, startpos, endpos, blend=1):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.aaline(self.surf,
 *                                renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1550; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1551
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.aaline(self.surf,             # <<<<<<<<<<<<<<
 *                                renpy.easy.color(color),
 *                                startpos,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aaline); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1552
 *             blit_lock.acquire()
 *             pygame.draw.aaline(self.surf,
 *                                renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                                startpos,
 *                                endpos,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1555
 *                                startpos,
 *                                endpos,
 *                                blend)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_startpos);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_startpos);
    __Pyx_GIVEREF(__pyx_v_startpos);
    __Pyx_INCREF(__pyx_v_endpos);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_endpos);
    __Pyx_GIVEREF(__pyx_v_endpos);
    __Pyx_INCREF(__pyx_v_blend);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_blend);
    __Pyx_GIVEREF(__pyx_v_blend);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1557
 *                                blend)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1548
 *             blit_lock.release()
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.aaline", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1559
 *             blit_lock.release()
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_19aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_19aalines = {"aalines", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_19aalines, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_19aalines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_closed = 0;
  PyObject *__pyx_v_pointlist = 0;
  PyObject *__pyx_v_blend = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("aalines (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_color,&__pyx_n_s_closed,&__pyx_n_s_pointlist,&__pyx_n_s_blend,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)__pyx_int_1));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_color)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pointlist)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_blend);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aalines") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_color = values[1];
    __pyx_v_closed = values[2];
    __pyx_v_pointlist = values[3];
    __pyx_v_blend = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("aalines", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("renpy.display.render.Canvas.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_18aalines(__pyx_self, __pyx_v_self, __pyx_v_color, __pyx_v_closed, __pyx_v_pointlist, __pyx_v_blend);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_18aalines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_closed, PyObject *__pyx_v_pointlist, PyObject *__pyx_v_blend) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  char const *__pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("aalines", 0);

  /* "renpy/display/render.pyx":1560
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):
 *         try:             # <<<<<<<<<<<<<<
 *             blit_lock.acquire()
 *             pygame.draw.aalines(self.surf,
 */
  /*try:*/ {

    /* "renpy/display/render.pyx":1561
 *     def aalines(self, color, closed, pointlist, blend=1):
 *         try:
 *             blit_lock.acquire()             # <<<<<<<<<<<<<<
 *             pygame.draw.aalines(self.surf,
 *                                 renpy.easy.color(color),
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_acquire); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "renpy/display/render.pyx":1562
 *         try:
 *             blit_lock.acquire()
 *             pygame.draw.aalines(self.surf,             # <<<<<<<<<<<<<<
 *                                 renpy.easy.color(color),
 *                                 closed,
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pygame); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_aalines); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_2);

    /* "renpy/display/render.pyx":1563
 *             blit_lock.acquire()
 *             pygame.draw.aalines(self.surf,
 *                                 renpy.easy.color(color),             # <<<<<<<<<<<<<<
 *                                 closed,
 *                                 pointlist,
 */
    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_easy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_color); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_color); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_color);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_color);
      __Pyx_GIVEREF(__pyx_v_color);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "renpy/display/render.pyx":1566
 *                                 closed,
 *                                 pointlist,
 *                                 blend)             # <<<<<<<<<<<<<<
 *         finally:
 *             blit_lock.release()
 */
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_8 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(5+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
    }
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_closed);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_8, __pyx_v_closed);
    __Pyx_GIVEREF(__pyx_v_closed);
    __Pyx_INCREF(__pyx_v_pointlist);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_8, __pyx_v_pointlist);
    __Pyx_GIVEREF(__pyx_v_pointlist);
    __Pyx_INCREF(__pyx_v_blend);
    PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_8, __pyx_v_blend);
    __Pyx_GIVEREF(__pyx_v_blend);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "renpy/display/render.pyx":1568
 *                                 blend)
 *         finally:
 *             blit_lock.release()             # <<<<<<<<<<<<<<
 * 
 *     def get_surface(self):
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_release); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __pyx_L4_error:;
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __Pyx_XGOTREF(__pyx_t_17);
      __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
      {
        __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_blit_lock); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_release); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_7)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_7);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        if (__pyx_t_7) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_XGIVEREF(__pyx_t_14);
      __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
      __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
      goto __pyx_L1_error;
      __pyx_L7_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_XGIVEREF(__pyx_t_17);
        __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
      }
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "renpy/display/render.pyx":1559
 *             blit_lock.release()
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("renpy.display.render.Canvas.aalines", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/render.pyx":1570
 *             blit_lock.release()
 * 
 *     def get_surface(self):             # <<<<<<<<<<<<<<
 *         return self.surf
 */

/* Python wrapper */
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_21get_surface(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_5renpy_7display_6render_6Canvas_21get_surface = {"get_surface", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Canvas_21get_surface, METH_O, 0};
static PyObject *__pyx_pw_5renpy_7display_6render_6Canvas_21get_surface(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_surface (wrapper)", 0);
  __pyx_r = __pyx_pf_5renpy_7display_6render_6Canvas_20get_surface(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_5renpy_7display_6render_6Canvas_20get_surface(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_surface", 0);

  /* "renpy/display/render.pyx":1571
 * 
 *     def get_surface(self):
 *         return self.surf             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_surf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "renpy/display/render.pyx":1570
 *             blit_lock.release()
 * 
 *     def get_surface(self):             # <<<<<<<<<<<<<<
 *         return self.surf
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("renpy.display.render.Canvas.get_surface", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "renpy/display/matrix.pxd":26
 * 
 * 
 *     cdef inline void transform4(Matrix self, float *ox, float *oy, float *oz, float *ow, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform4(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float *__pyx_v_oz, float *__pyx_v_ow, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("transform4", 0);

  /* "renpy/display/matrix.pxd":27
 * 
 *     cdef inline void transform4(Matrix self, float *ox, float *oy, float *oz, float *ow, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw             # <<<<<<<<<<<<<<
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 */
  (__pyx_v_ox[0]) = ((((__pyx_v_x * __pyx_v_self->xdx) + (__pyx_v_y * __pyx_v_self->xdy)) + (__pyx_v_z * __pyx_v_self->xdz)) + (__pyx_v_w * __pyx_v_self->xdw));

  /* "renpy/display/matrix.pxd":28
 *     cdef inline void transform4(Matrix self, float *ox, float *oy, float *oz, float *ow, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw             # <<<<<<<<<<<<<<
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 *         ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw
 */
  (__pyx_v_oy[0]) = ((((__pyx_v_x * __pyx_v_self->ydx) + (__pyx_v_y * __pyx_v_self->ydy)) + (__pyx_v_z * __pyx_v_self->ydz)) + (__pyx_v_w * __pyx_v_self->ydw));

  /* "renpy/display/matrix.pxd":29
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw             # <<<<<<<<<<<<<<
 *         ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw
 * 
 */
  (__pyx_v_oz[0]) = ((((__pyx_v_x * __pyx_v_self->zdx) + (__pyx_v_y * __pyx_v_self->zdy)) + (__pyx_v_z * __pyx_v_self->zdz)) + (__pyx_v_w * __pyx_v_self->zdw));

  /* "renpy/display/matrix.pxd":30
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 *         ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):
 */
  (__pyx_v_ow[0]) = ((((__pyx_v_x * __pyx_v_self->wdx) + (__pyx_v_y * __pyx_v_self->wdy)) + (__pyx_v_z * __pyx_v_self->wdz)) + (__pyx_v_w * __pyx_v_self->wdw));

  /* "renpy/display/matrix.pxd":26
 * 
 * 
 *     cdef inline void transform4(Matrix self, float *ox, float *oy, float *oz, float *ow, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/display/matrix.pxd":32
 *         ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw
 * 
 *     cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform3(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float *__pyx_v_oz, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("transform3", 0);

  /* "renpy/display/matrix.pxd":33
 * 
 *     cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw             # <<<<<<<<<<<<<<
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 */
  (__pyx_v_ox[0]) = ((((__pyx_v_x * __pyx_v_self->xdx) + (__pyx_v_y * __pyx_v_self->xdy)) + (__pyx_v_z * __pyx_v_self->xdz)) + (__pyx_v_w * __pyx_v_self->xdw));

  /* "renpy/display/matrix.pxd":34
 *     cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw             # <<<<<<<<<<<<<<
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 * 
 */
  (__pyx_v_oy[0]) = ((((__pyx_v_x * __pyx_v_self->ydx) + (__pyx_v_y * __pyx_v_self->ydy)) + (__pyx_v_z * __pyx_v_self->ydz)) + (__pyx_v_w * __pyx_v_self->ydw));

  /* "renpy/display/matrix.pxd":35
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):
 */
  (__pyx_v_oz[0]) = ((((__pyx_v_x * __pyx_v_self->zdx) + (__pyx_v_y * __pyx_v_self->zdy)) + (__pyx_v_z * __pyx_v_self->zdz)) + (__pyx_v_w * __pyx_v_self->zdw));

  /* "renpy/display/matrix.pxd":32
 *         ow[0] = x * self.wdx + y * self.wdy + z * self.wdz + w * self.wdw
 * 
 *     cdef inline void transform3(Matrix self, float *ox, float *oy, float *oz, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "renpy/display/matrix.pxd":37
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 * 
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

static CYTHON_INLINE void __pyx_f_5renpy_7display_6matrix_6Matrix_transform2(struct __pyx_obj_5renpy_7display_6matrix_Matrix *__pyx_v_self, float *__pyx_v_ox, float *__pyx_v_oy, float __pyx_v_x, float __pyx_v_y, float __pyx_v_z, float __pyx_v_w) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("transform2", 0);

  /* "renpy/display/matrix.pxd":38
 * 
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw             # <<<<<<<<<<<<<<
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 * 
 */
  (__pyx_v_ox[0]) = ((((__pyx_v_x * __pyx_v_self->xdx) + (__pyx_v_y * __pyx_v_self->xdy)) + (__pyx_v_z * __pyx_v_self->xdz)) + (__pyx_v_w * __pyx_v_self->xdw));

  /* "renpy/display/matrix.pxd":39
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint is_unit_aligned(Matrix self)
 */
  (__pyx_v_oy[0]) = ((((__pyx_v_x * __pyx_v_self->ydx) + (__pyx_v_y * __pyx_v_self->ydy)) + (__pyx_v_z * __pyx_v_self->ydz)) + (__pyx_v_w * __pyx_v_self->ydw));

  /* "renpy/display/matrix.pxd":37
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 * 
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
static struct __pyx_vtabstruct_5renpy_7display_6render_Render __pyx_vtable_5renpy_7display_6render_Render;

static PyObject *__pyx_tp_new_5renpy_7display_6render_Render(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_5renpy_7display_6render_Render *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_5renpy_7display_6render_Render *)o);
  p->__pyx_vtab = __pyx_vtabptr_5renpy_7display_6render_Render;
  p->layer_name = Py_None; Py_INCREF(Py_None);
  p->children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->parents = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->depends_on_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->operation_parameter = Py_None; Py_INCREF(Py_None);
  p->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None); Py_INCREF(Py_None);
  p->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None); Py_INCREF(Py_None);
  p->nearest = Py_None; Py_INCREF(Py_None);
  p->focuses = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->pass_focuses = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->focus_screen = Py_None; Py_INCREF(Py_None);
  p->draw_func = Py_None; Py_INCREF(Py_None);
  p->render_of = Py_None; Py_INCREF(Py_None);
  p->visible_children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->surface = Py_None; Py_INCREF(Py_None);
  p->alpha_surface = Py_None; Py_INCREF(Py_None);
  p->half_cache = Py_None; Py_INCREF(Py_None);
  p->mesh = Py_None; Py_INCREF(Py_None);
  p->shaders = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->uniforms = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->properties = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->cached_texture = Py_None; Py_INCREF(Py_None);
  p->cached_model = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_5renpy_7display_6render_Render(PyObject *o) {
  struct __pyx_obj_5renpy_7display_6render_Render *p = (struct __pyx_obj_5renpy_7display_6render_Render *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->layer_name);
  Py_CLEAR(p->children);
  Py_CLEAR(p->parents);
  Py_CLEAR(p->depends_on_list);
  Py_CLEAR(p->operation_parameter);
  Py_CLEAR(p->forward);
  Py_CLEAR(p->reverse);
  Py_CLEAR(p->nearest);
  Py_CLEAR(p->focuses);
  Py_CLEAR(p->pass_focuses);
  Py_CLEAR(p->focus_screen);
  Py_CLEAR(p->draw_func);
  Py_CLEAR(p->render_of);
  Py_CLEAR(p->visible_children);
  Py_CLEAR(p->surface);
  Py_CLEAR(p->alpha_surface);
  Py_CLEAR(p->half_cache);
  Py_CLEAR(p->mesh);
  Py_CLEAR(p->shaders);
  Py_CLEAR(p->uniforms);
  Py_CLEAR(p->properties);
  Py_CLEAR(p->cached_texture);
  Py_CLEAR(p->cached_model);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_5renpy_7display_6render_Render(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_5renpy_7display_6render_Render *p = (struct __pyx_obj_5renpy_7display_6render_Render *)o;
  if (p->layer_name) {
    e = (*v)(p->layer_name, a); if (e) return e;
  }
  if (p->children) {
    e = (*v)(p->children, a); if (e) return e;
  }
  if (p->parents) {
    e = (*v)(p->parents, a); if (e) return e;
  }
  if (p->depends_on_list) {
    e = (*v)(p->depends_on_list, a); if (e) return e;
  }
  if (p->operation_parameter) {
    e = (*v)(p->operation_parameter, a); if (e) return e;
  }
  if (p->forward) {
    e = (*v)(((PyObject*)p->forward), a); if (e) return e;
  }
  if (p->reverse) {
    e = (*v)(((PyObject*)p->reverse), a); if (e) return e;
  }
  if (p->nearest) {
    e = (*v)(p->nearest, a); if (e) return e;
  }
  if (p->focuses) {
    e = (*v)(p->focuses, a); if (e) return e;
  }
  if (p->pass_focuses) {
    e = (*v)(p->pass_focuses, a); if (e) return e;
  }
  if (p->focus_screen) {
    e = (*v)(p->focus_screen, a); if (e) return e;
  }
  if (p->draw_func) {
    e = (*v)(p->draw_func, a); if (e) return e;
  }
  if (p->render_of) {
    e = (*v)(p->render_of, a); if (e) return e;
  }
  if (p->visible_children) {
    e = (*v)(p->visible_children, a); if (e) return e;
  }
  if (p->surface) {
    e = (*v)(p->surface, a); if (e) return e;
  }
  if (p->alpha_surface) {
    e = (*v)(p->alpha_surface, a); if (e) return e;
  }
  if (p->half_cache) {
    e = (*v)(p->half_cache, a); if (e) return e;
  }
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  if (p->shaders) {
    e = (*v)(p->shaders, a); if (e) return e;
  }
  if (p->uniforms) {
    e = (*v)(p->uniforms, a); if (e) return e;
  }
  if (p->properties) {
    e = (*v)(p->properties, a); if (e) return e;
  }
  if (p->cached_texture) {
    e = (*v)(p->cached_texture, a); if (e) return e;
  }
  if (p->cached_model) {
    e = (*v)(p->cached_model, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_5renpy_7display_6render_Render(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_5renpy_7display_6render_Render *p = (struct __pyx_obj_5renpy_7display_6render_Render *)o;
  tmp = ((PyObject*)p->layer_name);
  p->layer_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->children);
  p->children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->parents);
  p->parents = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->depends_on_list);
  p->depends_on_list = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->operation_parameter);
  p->operation_parameter = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->forward);
  p->forward = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->reverse);
  p->reverse = ((struct __pyx_obj_5renpy_7display_6matrix_Matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->nearest);
  p->nearest = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->focuses);
  p->focuses = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pass_focuses);
  p->pass_focuses = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->focus_screen);
  p->focus_screen = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->draw_func);
  p->draw_func = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->render_of);
  p->render_of = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->visible_children);
  p->visible_children = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->surface);
  p->surface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->alpha_surface);
  p->alpha_surface = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->half_cache);
  p->half_cache = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->shaders);
  p->shaders = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->uniforms);
  p->uniforms = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->properties);
  p->properties = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cached_texture);
  p->cached_texture = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cached_model);
  p->cached_model = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_mark(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_4mark_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_mark(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_4mark_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_cache_killed(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_12cache_killed_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_cache_killed(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_12cache_killed_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_5width_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_5width_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_height(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_6height_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_6height_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_layer_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_10layer_name_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_layer_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_10layer_name_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_10layer_name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_8children_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_8children_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_8children_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_parents(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7parents_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_parents(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7parents_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7parents_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_depends_on_list(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_depends_on_list(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_15depends_on_list_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_operation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_9operation_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_operation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_9operation_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_operation_complete(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_18operation_complete_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_operation_complete(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_18operation_complete_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_operation_alpha(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_operation_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_15operation_alpha_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_operation_parameter(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_operation_parameter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_19operation_parameter_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_forward(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7forward_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_forward(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7forward_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7forward_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_reverse(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7reverse_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_reverse(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7reverse_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7reverse_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_alpha(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_5alpha_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_5alpha_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_over(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_4over_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_over(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_4over_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_nearest(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7nearest_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_nearest(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7nearest_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7nearest_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_focuses(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7focuses_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_focuses(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7focuses_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7focuses_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_pass_focuses(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_pass_focuses(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_12pass_focuses_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_focus_screen(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_focus_screen(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_12focus_screen_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_draw_func(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_9draw_func_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_draw_func(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_9draw_func_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_9draw_func_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_render_of(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_9render_of_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_render_of(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_9render_of_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_9render_of_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_opaque(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_6opaque_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_opaque(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_6opaque_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_visible_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_16visible_children_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_visible_children(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_16visible_children_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_16visible_children_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_xclipping(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_9xclipping_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_xclipping(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_9xclipping_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_yclipping(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_9yclipping_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_yclipping(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_9yclipping_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_surface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7surface_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7surface_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7surface_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_alpha_surface(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_alpha_surface(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_13alpha_surface_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_half_cache(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_10half_cache_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_half_cache(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_10half_cache_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_10half_cache_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_modal(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_5modal_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_modal(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_5modal_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_text_input(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_10text_input_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_text_input(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_10text_input_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_mesh(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_4mesh_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_mesh(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_4mesh_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_4mesh_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_shaders(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_7shaders_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_shaders(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_7shaders_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_7shaders_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_uniforms(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_8uniforms_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_uniforms(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_8uniforms_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_8uniforms_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_properties(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_10properties_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_properties(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_10properties_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_10properties_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_cached_texture(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_cached_texture(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_14cached_texture_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_cached_model(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_12cached_model_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_cached_model(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_12cached_model_3__set__(o, v);
  }
  else {
    return __pyx_pw_5renpy_7display_6render_6Render_12cached_model_5__del__(o);
  }
}

static PyObject *__pyx_getprop_5renpy_7display_6render_6Render_loaded(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_5renpy_7display_6render_6Render_6loaded_1__get__(o);
}

static int __pyx_setprop_5renpy_7display_6render_6Render_loaded(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_5renpy_7display_6render_6Render_6loaded_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_5renpy_7display_6render_Render[] = {
  {"__getstate__", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_5__getstate__, METH_NOARGS, 0},
  {"__setstate__", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_7__setstate__, METH_O, 0},
  {"blit", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_9blit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_8blit},
  {"subpixel_blit", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_11subpixel_blit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_10subpixel_blit},
  {"absolute_blit", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_13absolute_blit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_12absolute_blit},
  {"get_size", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_15get_size, METH_NOARGS, __pyx_doc_5renpy_7display_6render_6Render_14get_size},
  {"render_to_texture", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_17render_to_texture, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_16render_to_texture},
  {"subsurface", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_19subsurface, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_18subsurface},
  {"depends_on", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_21depends_on, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_20depends_on},
  {"kill_cache", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_23kill_cache, METH_NOARGS, __pyx_doc_5renpy_7display_6render_6Render_22kill_cache},
  {"kill", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_25kill, METH_NOARGS, __pyx_doc_5renpy_7display_6render_6Render_24kill},
  {"add_focus", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_27add_focus, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_26add_focus},
  {"take_focuses", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_29take_focuses, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_28take_focuses},
  {"focus_at_point", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_31focus_at_point, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_30focus_at_point},
  {"main_displayables_at_point", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_33main_displayables_at_point, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_32main_displayables_at_point},
  {"is_opaque", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_35is_opaque, METH_NOARGS, __pyx_doc_5renpy_7display_6render_6Render_34is_opaque},
  {"is_pixel_opaque", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_37is_pixel_opaque, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_36is_pixel_opaque},
  {"fill", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_39fill, METH_O, __pyx_doc_5renpy_7display_6render_6Render_38fill},
  {"canvas", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_41canvas, METH_NOARGS, __pyx_doc_5renpy_7display_6render_6Render_40canvas},
  {"screen_rect", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_43screen_rect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_42screen_rect},
  {"place", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_45place, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_44place},
  {"zoom", (PyCFunction)__pyx_pw_5renpy_7display_6render_6Render_47zoom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_6Render_46zoom},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5renpy_7display_6render_Render[] = {
  {(char *)"mark", __pyx_getprop_5renpy_7display_6render_6Render_mark, __pyx_setprop_5renpy_7display_6render_6Render_mark, 0, 0},
  {(char *)"cache_killed", __pyx_getprop_5renpy_7display_6render_6Render_cache_killed, __pyx_setprop_5renpy_7display_6render_6Render_cache_killed, 0, 0},
  {(char *)"width", __pyx_getprop_5renpy_7display_6render_6Render_width, __pyx_setprop_5renpy_7display_6render_6Render_width, 0, 0},
  {(char *)"height", __pyx_getprop_5renpy_7display_6render_6Render_height, __pyx_setprop_5renpy_7display_6render_6Render_height, 0, 0},
  {(char *)"layer_name", __pyx_getprop_5renpy_7display_6render_6Render_layer_name, __pyx_setprop_5renpy_7display_6render_6Render_layer_name, 0, 0},
  {(char *)"children", __pyx_getprop_5renpy_7display_6render_6Render_children, __pyx_setprop_5renpy_7display_6render_6Render_children, 0, 0},
  {(char *)"parents", __pyx_getprop_5renpy_7display_6render_6Render_parents, __pyx_setprop_5renpy_7display_6render_6Render_parents, 0, 0},
  {(char *)"depends_on_list", __pyx_getprop_5renpy_7display_6render_6Render_depends_on_list, __pyx_setprop_5renpy_7display_6render_6Render_depends_on_list, 0, 0},
  {(char *)"operation", __pyx_getprop_5renpy_7display_6render_6Render_operation, __pyx_setprop_5renpy_7display_6render_6Render_operation, 0, 0},
  {(char *)"operation_complete", __pyx_getprop_5renpy_7display_6render_6Render_operation_complete, __pyx_setprop_5renpy_7display_6render_6Render_operation_complete, 0, 0},
  {(char *)"operation_alpha", __pyx_getprop_5renpy_7display_6render_6Render_operation_alpha, __pyx_setprop_5renpy_7display_6render_6Render_operation_alpha, 0, 0},
  {(char *)"operation_parameter", __pyx_getprop_5renpy_7display_6render_6Render_operation_parameter, __pyx_setprop_5renpy_7display_6render_6Render_operation_parameter, 0, 0},
  {(char *)"forward", __pyx_getprop_5renpy_7display_6render_6Render_forward, __pyx_setprop_5renpy_7display_6render_6Render_forward, 0, 0},
  {(char *)"reverse", __pyx_getprop_5renpy_7display_6render_6Render_reverse, __pyx_setprop_5renpy_7display_6render_6Render_reverse, 0, 0},
  {(char *)"alpha", __pyx_getprop_5renpy_7display_6render_6Render_alpha, __pyx_setprop_5renpy_7display_6render_6Render_alpha, 0, 0},
  {(char *)"over", __pyx_getprop_5renpy_7display_6render_6Render_over, __pyx_setprop_5renpy_7display_6render_6Render_over, 0, 0},
  {(char *)"nearest", __pyx_getprop_5renpy_7display_6render_6Render_nearest, __pyx_setprop_5renpy_7display_6render_6Render_nearest, 0, 0},
  {(char *)"focuses", __pyx_getprop_5renpy_7display_6render_6Render_focuses, __pyx_setprop_5renpy_7display_6render_6Render_focuses, 0, 0},
  {(char *)"pass_focuses", __pyx_getprop_5renpy_7display_6render_6Render_pass_focuses, __pyx_setprop_5renpy_7display_6render_6Render_pass_focuses, 0, 0},
  {(char *)"focus_screen", __pyx_getprop_5renpy_7display_6render_6Render_focus_screen, __pyx_setprop_5renpy_7display_6render_6Render_focus_screen, 0, 0},
  {(char *)"draw_func", __pyx_getprop_5renpy_7display_6render_6Render_draw_func, __pyx_setprop_5renpy_7display_6render_6Render_draw_func, 0, 0},
  {(char *)"render_of", __pyx_getprop_5renpy_7display_6render_6Render_render_of, __pyx_setprop_5renpy_7display_6render_6Render_render_of, 0, 0},
  {(char *)"opaque", __pyx_getprop_5renpy_7display_6render_6Render_opaque, __pyx_setprop_5renpy_7display_6render_6Render_opaque, 0, 0},
  {(char *)"visible_children", __pyx_getprop_5renpy_7display_6render_6Render_visible_children, __pyx_setprop_5renpy_7display_6render_6Render_visible_children, 0, 0},
  {(char *)"xclipping", __pyx_getprop_5renpy_7display_6render_6Render_xclipping, __pyx_setprop_5renpy_7display_6render_6Render_xclipping, 0, 0},
  {(char *)"yclipping", __pyx_getprop_5renpy_7display_6render_6Render_yclipping, __pyx_setprop_5renpy_7display_6render_6Render_yclipping, 0, 0},
  {(char *)"surface", __pyx_getprop_5renpy_7display_6render_6Render_surface, __pyx_setprop_5renpy_7display_6render_6Render_surface, 0, 0},
  {(char *)"alpha_surface", __pyx_getprop_5renpy_7display_6render_6Render_alpha_surface, __pyx_setprop_5renpy_7display_6render_6Render_alpha_surface, 0, 0},
  {(char *)"half_cache", __pyx_getprop_5renpy_7display_6render_6Render_half_cache, __pyx_setprop_5renpy_7display_6render_6Render_half_cache, 0, 0},
  {(char *)"modal", __pyx_getprop_5renpy_7display_6render_6Render_modal, __pyx_setprop_5renpy_7display_6render_6Render_modal, 0, 0},
  {(char *)"text_input", __pyx_getprop_5renpy_7display_6render_6Render_text_input, __pyx_setprop_5renpy_7display_6render_6Render_text_input, 0, 0},
  {(char *)"mesh", __pyx_getprop_5renpy_7display_6render_6Render_mesh, __pyx_setprop_5renpy_7display_6render_6Render_mesh, 0, 0},
  {(char *)"shaders", __pyx_getprop_5renpy_7display_6render_6Render_shaders, __pyx_setprop_5renpy_7display_6render_6Render_shaders, 0, 0},
  {(char *)"uniforms", __pyx_getprop_5renpy_7display_6render_6Render_uniforms, __pyx_setprop_5renpy_7display_6render_6Render_uniforms, 0, 0},
  {(char *)"properties", __pyx_getprop_5renpy_7display_6render_6Render_properties, __pyx_setprop_5renpy_7display_6render_6Render_properties, 0, 0},
  {(char *)"cached_texture", __pyx_getprop_5renpy_7display_6render_6Render_cached_texture, __pyx_setprop_5renpy_7display_6render_6Render_cached_texture, 0, 0},
  {(char *)"cached_model", __pyx_getprop_5renpy_7display_6render_6Render_cached_model, __pyx_setprop_5renpy_7display_6render_6Render_cached_model, 0, 0},
  {(char *)"loaded", __pyx_getprop_5renpy_7display_6render_6Render_loaded, __pyx_setprop_5renpy_7display_6render_6Render_loaded, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_5renpy_7display_6render_Render = {
  PyVarObject_HEAD_INIT(0, 0)
  "renpy.display.render.Render", /*tp_name*/
  sizeof(struct __pyx_obj_5renpy_7display_6render_Render), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_5renpy_7display_6render_Render, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_5renpy_7display_6render_6Render_3__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_5renpy_7display_6render_Render, /*tp_traverse*/
  __pyx_tp_clear_5renpy_7display_6render_Render, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_5renpy_7display_6render_Render, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_5renpy_7display_6render_Render, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_5renpy_7display_6render_6Render_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_5renpy_7display_6render_Render, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"render", (PyCFunction)__pyx_pw_5renpy_7display_6render_9render, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5renpy_7display_6render_8render},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "render",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_BLIT, __pyx_k_BLIT, sizeof(__pyx_k_BLIT), 0, 0, 1, 1},
  {&__pyx_kp_s_Blitting_to_self, __pyx_k_Blitting_to_self, sizeof(__pyx_k_Blitting_to_self), 0, 0, 1, 0},
  {&__pyx_kp_s_Can_t_pickle_a_Render, __pyx_k_Can_t_pickle_a_Render, sizeof(__pyx_k_Can_t_pickle_a_Render), 0, 0, 1, 0},
  {&__pyx_n_s_Canvas, __pyx_k_Canvas, sizeof(__pyx_k_Canvas), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas___init, __pyx_k_Canvas___init, sizeof(__pyx_k_Canvas___init), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_aaline, __pyx_k_Canvas_aaline, sizeof(__pyx_k_Canvas_aaline), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_aalines, __pyx_k_Canvas_aalines, sizeof(__pyx_k_Canvas_aalines), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_arc, __pyx_k_Canvas_arc, sizeof(__pyx_k_Canvas_arc), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_circle, __pyx_k_Canvas_circle, sizeof(__pyx_k_Canvas_circle), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_ellipse, __pyx_k_Canvas_ellipse, sizeof(__pyx_k_Canvas_ellipse), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_get_surface, __pyx_k_Canvas_get_surface, sizeof(__pyx_k_Canvas_get_surface), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_line, __pyx_k_Canvas_line, sizeof(__pyx_k_Canvas_line), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_lines, __pyx_k_Canvas_lines, sizeof(__pyx_k_Canvas_lines), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_polygon, __pyx_k_Canvas_polygon, sizeof(__pyx_k_Canvas_polygon), 0, 0, 1, 1},
  {&__pyx_n_s_Canvas_rect, __pyx_k_Canvas_rect, sizeof(__pyx_k_Canvas_rect), 0, 0, 1, 1},
  {&__pyx_n_s_Condition, __pyx_k_Condition, sizeof(__pyx_k_Condition), 0, 0, 1, 1},
  {&__pyx_kp_s_Creating_subsurface_failed_child, __pyx_k_Creating_subsurface_failed_child, sizeof(__pyx_k_Creating_subsurface_failed_child), 0, 0, 1, 0},
  {&__pyx_n_s_DISSOLVE, __pyx_k_DISSOLVE, sizeof(__pyx_k_DISSOLVE), 0, 0, 1, 1},
  {&__pyx_kp_s_Displayables_may_not_be_rendered, __pyx_k_Displayables_may_not_be_rendered, sizeof(__pyx_k_Displayables_may_not_be_rendered), 0, 0, 1, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_n_s_FLATTEN, __pyx_k_FLATTEN, sizeof(__pyx_k_FLATTEN), 0, 0, 1, 1},
  {&__pyx_n_s_Focus, __pyx_k_Focus, sizeof(__pyx_k_Focus), 0, 0, 1, 1},
  {&__pyx_n_s_IDENTITY, __pyx_k_IDENTITY, sizeof(__pyx_k_IDENTITY), 0, 0, 1, 1},
  {&__pyx_n_s_IMAGEDISSOLVE, __pyx_k_IMAGEDISSOLVE, sizeof(__pyx_k_IMAGEDISSOLVE), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix, __pyx_k_Matrix, sizeof(__pyx_k_Matrix), 0, 0, 1, 1},
  {&__pyx_n_s_Matrix2D, __pyx_k_Matrix2D, sizeof(__pyx_k_Matrix2D), 0, 0, 1, 1},
  {&__pyx_n_s_Modal, __pyx_k_Modal, sizeof(__pyx_k_Modal), 0, 0, 1, 1},
  {&__pyx_n_s_PIXELLATE, __pyx_k_PIXELLATE, sizeof(__pyx_k_PIXELLATE), 0, 0, 1, 1},
  {&__pyx_kp_s_Render_depends_on_itself, __pyx_k_Render_depends_on_itself, sizeof(__pyx_k_Render_depends_on_itself), 0, 0, 1, 0},
  {&__pyx_kp_s_Render_x_of_r, __pyx_k_Render_x_of_r, sizeof(__pyx_k_Render_x_of_r), 0, 0, 1, 0},
  {&__pyx_n_s_ScreenDisplayable, __pyx_k_ScreenDisplayable, sizeof(__pyx_k_ScreenDisplayable), 0, 0, 1, 1},
  {&__pyx_n_s_Sentinel, __pyx_k_Sentinel, sizeof(__pyx_k_Sentinel), 0, 0, 1, 1},
  {&__pyx_n_s_Solid, __pyx_k_Solid, sizeof(__pyx_k_Solid), 0, 0, 1, 1},
  {&__pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_k_Users_tom_ab_renpy_renpy_displa, sizeof(__pyx_k_Users_tom_ab_renpy_renpy_displa), 0, 0, 1, 0},
  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  {&__pyx_n_s_aaline, __pyx_k_aaline, sizeof(__pyx_k_aaline), 0, 0, 1, 1},
  {&__pyx_n_s_aalines, __pyx_k_aalines, sizeof(__pyx_k_aalines), 0, 0, 1, 1},
  {&__pyx_n_s_absolute, __pyx_k_absolute, sizeof(__pyx_k_absolute), 0, 0, 1, 1},
  {&__pyx_n_s_absolute_blit, __pyx_k_absolute_blit, sizeof(__pyx_k_absolute_blit), 0, 0, 1, 1},
  {&__pyx_n_s_acquire, __pyx_k_acquire, sizeof(__pyx_k_acquire), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_add_focus, __pyx_k_add_focus, sizeof(__pyx_k_add_focus), 0, 0, 1, 1},
  {&__pyx_n_s_adjust_render_cache_times, __pyx_k_adjust_render_cache_times, sizeof(__pyx_k_adjust_render_cache_times), 0, 0, 1, 1},
  {&__pyx_kp_s_after_clipping, __pyx_k_after_clipping, sizeof(__pyx_k_after_clipping), 0, 0, 1, 0},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arc, __pyx_k_arc, sizeof(__pyx_k_arc), 0, 0, 1, 1},
  {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1},
  {&__pyx_n_s_at, __pyx_k_at, sizeof(__pyx_k_at), 0, 0, 1, 1},
  {&__pyx_n_s_at_base, __pyx_k_at_base, sizeof(__pyx_k_at_base), 0, 0, 1, 1},
  {&__pyx_kp_s_before_clipping, __pyx_k_before_clipping, sizeof(__pyx_k_before_clipping), 0, 0, 1, 0},
  {&__pyx_n_s_blend, __pyx_k_blend, sizeof(__pyx_k_blend), 0, 0, 1, 1},
  {&__pyx_n_s_blit, __pyx_k_blit, sizeof(__pyx_k_blit), 0, 0, 1, 1},
  {&__pyx_n_s_blit_lock, __pyx_k_blit_lock, sizeof(__pyx_k_blit_lock), 0, 0, 1, 1},
  {&__pyx_n_s_cache_killed, __pyx_k_cache_killed, sizeof(__pyx_k_cache_killed), 0, 0, 1, 1},
  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_cf, __pyx_k_cf, sizeof(__pyx_k_cf), 0, 0, 1, 1},
  {&__pyx_n_s_check_at_shutdown, __pyx_k_check_at_shutdown, sizeof(__pyx_k_check_at_shutdown), 0, 0, 1, 1},
  {&__pyx_n_s_check_redraws, __pyx_k_check_redraws, sizeof(__pyx_k_check_redraws), 0, 0, 1, 1},
  {&__pyx_n_s_circle, __pyx_k_circle, sizeof(__pyx_k_circle), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_clipping, __pyx_k_clipping, sizeof(__pyx_k_clipping), 0, 0, 1, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_s_cmaxx, __pyx_k_cmaxx, sizeof(__pyx_k_cmaxx), 0, 0, 1, 1},
  {&__pyx_n_s_cmaxy, __pyx_k_cmaxy, sizeof(__pyx_k_cmaxy), 0, 0, 1, 1},
  {&__pyx_n_s_cminx, __pyx_k_cminx, sizeof(__pyx_k_cminx), 0, 0, 1, 1},
  {&__pyx_n_s_cminy, __pyx_k_cminy, sizeof(__pyx_k_cminy), 0, 0, 1, 1},
  {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_n_s_compute_subline, __pyx_k_compute_subline, sizeof(__pyx_k_compute_subline), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_core, __pyx_k_core, sizeof(__pyx_k_core), 0, 0, 1, 1},
  {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
  {&__pyx_n_s_crop, __pyx_k_crop, sizeof(__pyx_k_crop), 0, 0, 1, 1},
  {&__pyx_n_s_cw, __pyx_k_cw, sizeof(__pyx_k_cw), 0, 0, 1, 1},
  {&__pyx_n_s_cx0, __pyx_k_cx0, sizeof(__pyx_k_cx0), 0, 0, 1, 1},
  {&__pyx_n_s_cx1, __pyx_k_cx1, sizeof(__pyx_k_cx1), 0, 0, 1, 1},
  {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1},
  {&__pyx_kp_s_d_Renders_are_alive_at_shutdown, __pyx_k_d_Renders_are_alive_at_shutdown, sizeof(__pyx_k_d_Renders_are_alive_at_shutdown), 0, 0, 1, 0},
  {&__pyx_kp_s_dead, __pyx_k_dead, sizeof(__pyx_k_dead), 0, 0, 1, 0},
  {&__pyx_n_s_defaultdict, __pyx_k_defaultdict, sizeof(__pyx_k_defaultdict), 0, 0, 1, 1},
  {&__pyx_n_s_depends_on, __pyx_k_depends_on, sizeof(__pyx_k_depends_on), 0, 0, 1, 1},
  {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
  {&__pyx_n_s_developer, __pyx_k_developer, sizeof(__pyx_k_developer), 0, 0, 1, 1},
  {&__pyx_n_s_discard, __pyx_k_discard, sizeof(__pyx_k_discard), 0, 0, 1, 1},
  {&__pyx_n_s_display, __pyx_k_display, sizeof(__pyx_k_display), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_n_s_draw_func, __pyx_k_draw_func, sizeof(__pyx_k_draw_func), 0, 0, 1, 1},
  {&__pyx_n_s_easy, __pyx_k_easy, sizeof(__pyx_k_easy), 0, 0, 1, 1},
  {&__pyx_n_s_ellipse, __pyx_k_ellipse, sizeof(__pyx_k_ellipse), 0, 0, 1, 1},
  {&__pyx_n_s_end_pos, __pyx_k_end_pos, sizeof(__pyx_k_end_pos), 0, 0, 1, 1},
  {&__pyx_kp_s_end_render_r, __pyx_k_end_render_r, sizeof(__pyx_k_end_render_r), 0, 0, 1, 0},
  {&__pyx_n_s_endpos, __pyx_k_endpos, sizeof(__pyx_k_endpos), 0, 0, 1, 1},
  {&__pyx_n_s_focus, __pyx_k_focus, sizeof(__pyx_k_focus), 0, 0, 1, 1},
  {&__pyx_n_s_focus_at_point, __pyx_k_focus_at_point, sizeof(__pyx_k_focus_at_point), 0, 0, 1, 1},
  {&__pyx_n_s_focuses, __pyx_k_focuses, sizeof(__pyx_k_focuses), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_s_frame_time, __pyx_k_frame_time, sizeof(__pyx_k_frame_time), 0, 0, 1, 1},
  {&__pyx_n_s_free_memory, __pyx_k_free_memory, sizeof(__pyx_k_free_memory), 0, 0, 1, 1},
  {&__pyx_n_s_game, __pyx_k_game, sizeof(__pyx_k_game), 0, 0, 1, 1},
  {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_objects, __pyx_k_get_objects, sizeof(__pyx_k_get_objects), 0, 0, 1, 1},
  {&__pyx_n_s_get_size, __pyx_k_get_size, sizeof(__pyx_k_get_size), 0, 0, 1, 1},
  {&__pyx_n_s_get_surface, __pyx_k_get_surface, sizeof(__pyx_k_get_surface), 0, 0, 1, 1},
  {&__pyx_n_s_get_time, __pyx_k_get_time, sizeof(__pyx_k_get_time), 0, 0, 1, 1},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_n_s_heighto, __pyx_k_heighto, sizeof(__pyx_k_heighto), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_n_s_id_d, __pyx_k_id_d, sizeof(__pyx_k_id_d), 0, 0, 1, 1},
  {&__pyx_n_s_imagelike, __pyx_k_imagelike, sizeof(__pyx_k_imagelike), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_interact_time, __pyx_k_interact_time, sizeof(__pyx_k_interact_time), 0, 0, 1, 1},
  {&__pyx_n_s_interface, __pyx_k_interface, sizeof(__pyx_k_interface), 0, 0, 1, 1},
  {&__pyx_n_s_invalidate, __pyx_k_invalidate, sizeof(__pyx_k_invalidate), 0, 0, 1, 1},
  {&__pyx_n_s_invalidated, __pyx_k_invalidated, sizeof(__pyx_k_invalidated), 0, 0, 1, 1},
  {&__pyx_n_s_is_opaque, __pyx_k_is_opaque, sizeof(__pyx_k_is_opaque), 0, 0, 1, 1},
  {&__pyx_n_s_is_pixel_opaque, __pyx_k_is_pixel_opaque, sizeof(__pyx_k_is_pixel_opaque), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_kill_cache, __pyx_k_kill_cache, sizeof(__pyx_k_kill_cache), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_layer_name, __pyx_k_layer_name, sizeof(__pyx_k_layer_name), 0, 0, 1, 1},
  {&__pyx_n_s_layers, __pyx_k_layers, sizeof(__pyx_k_layers), 0, 0, 1, 1},
  {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1},
  {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_main_2, __pyx_k_main_2, sizeof(__pyx_k_main_2), 0, 0, 1, 1},
  {&__pyx_n_s_main_displayables_at_point, __pyx_k_main_displayables_at_point, sizeof(__pyx_k_main_displayables_at_point), 0, 0, 1, 1},
  {&__pyx_n_s_mark, __pyx_k_mark, sizeof(__pyx_k_mark), 0, 0, 1, 1},
  {&__pyx_n_s_mark_sweep, __pyx_k_mark_sweep, sizeof(__pyx_k_mark_sweep), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_models, __pyx_k_models, sizeof(__pyx_k_models), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mutated_surface, __pyx_k_mutated_surface, sizeof(__pyx_k_mutated_surface), 0, 0, 1, 1},
  {&__pyx_n_s_mx, __pyx_k_mx, sizeof(__pyx_k_mx), 0, 0, 1, 1},
  {&__pyx_n_s_my, __pyx_k_my, sizeof(__pyx_k_my), 0, 0, 1, 1},
  {&__pyx_n_s_new_redraw_queue, __pyx_k_new_redraw_queue, sizeof(__pyx_k_new_redraw_queue), 0, 0, 1, 1},
  {&__pyx_n_s_new_renders, __pyx_k_new_renders, sizeof(__pyx_k_new_renders), 0, 0, 1, 1},
  {&__pyx_n_s_new_time, __pyx_k_new_time, sizeof(__pyx_k_new_time), 0, 0, 1, 1},
  {&__pyx_n_s_now, __pyx_k_now, sizeof(__pyx_k_now), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_old_sizing, __pyx_k_old_sizing, sizeof(__pyx_k_old_sizing), 0, 0, 1, 1},
  {&__pyx_n_s_old_time, __pyx_k_old_time, sizeof(__pyx_k_old_time), 0, 0, 1, 1},
  {&__pyx_n_s_opaque, __pyx_k_opaque, sizeof(__pyx_k_opaque), 0, 0, 1, 1},
  {&__pyx_n_s_orig_wh, __pyx_k_orig_wh, sizeof(__pyx_k_orig_wh), 0, 0, 1, 1},
  {&__pyx_n_s_parents, __pyx_k_parents, sizeof(__pyx_k_parents), 0, 0, 1, 1},
  {&__pyx_n_s_per_frame, __pyx_k_per_frame, sizeof(__pyx_k_per_frame), 0, 0, 1, 1},
  {&__pyx_n_s_pgrender, __pyx_k_pgrender, sizeof(__pyx_k_pgrender), 0, 0, 1, 1},
  {&__pyx_n_s_place, __pyx_k_place, sizeof(__pyx_k_place), 0, 0, 1, 1},
  {&__pyx_n_s_plog, __pyx_k_plog, sizeof(__pyx_k_plog), 0, 0, 1, 1},
  {&__pyx_n_s_pointlist, __pyx_k_pointlist, sizeof(__pyx_k_pointlist), 0, 0, 1, 1},
  {&__pyx_n_s_polygon, __pyx_k_polygon, sizeof(__pyx_k_polygon), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_process_redraws, __pyx_k_process_redraws, sizeof(__pyx_k_process_redraws), 0, 0, 1, 1},
  {&__pyx_n_s_pygame, __pyx_k_pygame, sizeof(__pyx_k_pygame), 0, 0, 1, 1},
  {&__pyx_n_s_pygame_sdl2, __pyx_k_pygame_sdl2, sizeof(__pyx_k_pygame_sdl2), 0, 0, 1, 1},
  {&__pyx_n_s_pygame_surface, __pyx_k_pygame_surface, sizeof(__pyx_k_pygame_surface), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_kp_s_r_render_must_return_a_Render, __pyx_k_r_render_must_return_a_Render, sizeof(__pyx_k_r_render_must_return_a_Render), 0, 0, 1, 0},
  {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1},
  {&__pyx_n_s_rect, __pyx_k_rect, sizeof(__pyx_k_rect), 0, 0, 1, 1},
  {&__pyx_n_s_redraw, __pyx_k_redraw, sizeof(__pyx_k_redraw), 0, 0, 1, 1},
  {&__pyx_n_s_redraw_queue, __pyx_k_redraw_queue, sizeof(__pyx_k_redraw_queue), 0, 0, 1, 1},
  {&__pyx_n_s_redraw_time, __pyx_k_redraw_time, sizeof(__pyx_k_redraw_time), 0, 0, 1, 1},
  {&__pyx_n_s_release, __pyx_k_release, sizeof(__pyx_k_release), 0, 0, 1, 1},
  {&__pyx_n_s_render, __pyx_k_render, sizeof(__pyx_k_render), 0, 0, 1, 1},
  {&__pyx_n_s_render_at, __pyx_k_render_at, sizeof(__pyx_k_render_at), 0, 0, 1, 1},
  {&__pyx_n_s_render_cache, __pyx_k_render_cache, sizeof(__pyx_k_render_cache), 0, 0, 1, 1},
  {&__pyx_n_s_render_cache_d, __pyx_k_render_cache_d, sizeof(__pyx_k_render_cache_d), 0, 0, 1, 1},
  {&__pyx_n_s_render_for_size, __pyx_k_render_for_size, sizeof(__pyx_k_render_for_size), 0, 0, 1, 1},
  {&__pyx_n_s_render_height, __pyx_k_render_height, sizeof(__pyx_k_render_height), 0, 0, 1, 1},
  {&__pyx_n_s_render_of, __pyx_k_render_of, sizeof(__pyx_k_render_of), 0, 0, 1, 1},
  {&__pyx_n_s_render_ready, __pyx_k_render_ready, sizeof(__pyx_k_render_ready), 0, 0, 1, 1},
  {&__pyx_n_s_render_screen, __pyx_k_render_screen, sizeof(__pyx_k_render_screen), 0, 0, 1, 1},
  {&__pyx_n_s_render_st, __pyx_k_render_st, sizeof(__pyx_k_render_st), 0, 0, 1, 1},
  {&__pyx_n_s_render_to_texture, __pyx_k_render_to_texture, sizeof(__pyx_k_render_to_texture), 0, 0, 1, 1},
  {&__pyx_n_s_render_width, __pyx_k_render_width, sizeof(__pyx_k_render_width), 0, 0, 1, 1},
  {&__pyx_n_s_renders, __pyx_k_renders, sizeof(__pyx_k_renders), 0, 0, 1, 1},
  {&__pyx_n_s_renpy, __pyx_k_renpy, sizeof(__pyx_k_renpy), 0, 0, 1, 1},
  {&__pyx_n_s_renpy_display_matrix, __pyx_k_renpy_display_matrix, sizeof(__pyx_k_renpy_display_matrix), 0, 0, 1, 1},
  {&__pyx_n_s_renpy_display_render, __pyx_k_renpy_display_render, sizeof(__pyx_k_renpy_display_render), 0, 0, 1, 1},
  {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1},
  {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
  {&__pyx_n_s_rv, __pyx_k_rv, sizeof(__pyx_k_rv), 0, 0, 1, 1},
  {&__pyx_n_s_screen, __pyx_k_screen, sizeof(__pyx_k_screen), 0, 0, 1, 1},
  {&__pyx_n_s_screen_render, __pyx_k_screen_render, sizeof(__pyx_k_screen_render), 0, 0, 1, 1},
  {&__pyx_n_s_seen, __pyx_k_seen, sizeof(__pyx_k_seen), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_sizing, __pyx_k_sizing, sizeof(__pyx_k_sizing), 0, 0, 1, 1},
  {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_st, __pyx_k_st, sizeof(__pyx_k_st), 0, 0, 1, 1},
  {&__pyx_n_s_st_base, __pyx_k_st_base, sizeof(__pyx_k_st_base), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_start_angle, __pyx_k_start_angle, sizeof(__pyx_k_start_angle), 0, 0, 1, 1},
  {&__pyx_n_s_start_pos, __pyx_k_start_pos, sizeof(__pyx_k_start_pos), 0, 0, 1, 1},
  {&__pyx_kp_s_start_render_r, __pyx_k_start_render_r, sizeof(__pyx_k_start_render_r), 0, 0, 1, 0},
  {&__pyx_n_s_startpos, __pyx_k_startpos, sizeof(__pyx_k_startpos), 0, 0, 1, 1},
  {&__pyx_n_s_stop_angle, __pyx_k_stop_angle, sizeof(__pyx_k_stop_angle), 0, 0, 1, 1},
  {&__pyx_n_s_style, __pyx_k_style, sizeof(__pyx_k_style), 0, 0, 1, 1},
  {&__pyx_n_s_subpixel_blit, __pyx_k_subpixel_blit, sizeof(__pyx_k_subpixel_blit), 0, 0, 1, 1},
  {&__pyx_n_s_subsurface, __pyx_k_subsurface, sizeof(__pyx_k_subsurface), 0, 0, 1, 1},
  {&__pyx_n_s_surf, __pyx_k_surf, sizeof(__pyx_k_surf), 0, 0, 1, 1},
  {&__pyx_n_s_surface, __pyx_k_surface, sizeof(__pyx_k_surface), 0, 0, 1, 1},
  {&__pyx_n_s_surftree, __pyx_k_surftree, sizeof(__pyx_k_surftree), 0, 0, 1, 1},
  {&__pyx_n_s_sw, __pyx_k_sw, sizeof(__pyx_k_sw), 0, 0, 1, 1},
  {&__pyx_n_s_sx, __pyx_k_sx, sizeof(__pyx_k_sx), 0, 0, 1, 1},
  {&__pyx_n_s_sx0, __pyx_k_sx0, sizeof(__pyx_k_sx0), 0, 0, 1, 1},
  {&__pyx_n_s_sx1, __pyx_k_sx1, sizeof(__pyx_k_sx1), 0, 0, 1, 1},
  {&__pyx_n_s_sy, __pyx_k_sy, sizeof(__pyx_k_sy), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_take_focuses, __pyx_k_take_focuses, sizeof(__pyx_k_take_focuses), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 0, 0, 1, 1},
  {&__pyx_n_s_transform, __pyx_k_transform, sizeof(__pyx_k_transform), 0, 0, 1, 1},
  {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_when, __pyx_k_when, sizeof(__pyx_k_when), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_widtho, __pyx_k_widtho, sizeof(__pyx_k_widtho), 0, 0, 1, 1},
  {&__pyx_n_s_worklist, __pyx_k_worklist, sizeof(__pyx_k_worklist), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xclipping, __pyx_k_xclipping, sizeof(__pyx_k_xclipping), 0, 0, 1, 1},
  {&__pyx_n_s_xmaximum, __pyx_k_xmaximum, sizeof(__pyx_k_xmaximum), 0, 0, 1, 1},
  {&__pyx_n_s_xzoom, __pyx_k_xzoom, sizeof(__pyx_k_xzoom), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_yclipping, __pyx_k_yclipping, sizeof(__pyx_k_yclipping), 0, 0, 1, 1},
  {&__pyx_n_s_ymaximum, __pyx_k_ymaximum, sizeof(__pyx_k_ymaximum), 0, 0, 1, 1},
  {&__pyx_n_s_yzoom, __pyx_k_yzoom, sizeof(__pyx_k_yzoom), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "renpy/display/render.pyx":201
 *     if not render_is_ready:
 *         if renpy.config.developer:
 *             raise Exception("Displayables may not be rendered during the init phase.")             # <<<<<<<<<<<<<<
 * 
 *     orig_wh = (widtho, heighto, frame_time-st, frame_time-at)
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Displayables_may_not_be_rendered); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "renpy/display/render.pyx":271
 * 
 *     if d._clipping:
 *         renpy.plog(4, "before clipping")             # <<<<<<<<<<<<<<
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 *         rv.render_of.append(d)
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_4, __pyx_kp_s_before_clipping); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "renpy/display/render.pyx":274
 *         rv = rv.subsurface((0, 0, rv.width, rv.height), focus=True)
 *         rv.render_of.append(d)
 *         renpy.plog(4, "after clipping")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_4, __pyx_kp_s_after_clipping); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "renpy/display/render.pyx":729
 *     def __getstate__(self): #@DuplicatedSignature
 *         if renpy.config.developer:
 *             raise Exception("Can't pickle a Render.")             # <<<<<<<<<<<<<<
 *         else:
 *             return { }
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Can_t_pickle_a_Render); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "renpy/display/render.pyx":750
 * 
 *         if source is self:
 *             raise Exception("Blitting to self.")             # <<<<<<<<<<<<<<
 * 
 *         xo = int(xo)
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Blitting_to_self); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "renpy/display/render.pyx":981
 *                     newchild.width = cw
 *                     newchild.height = ch
 *                     newchild.render_of = child.render_of[:]             # <<<<<<<<<<<<<<
 * 
 *                 else:
 */
  __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__7);
  __Pyx_GIVEREF(__pyx_slice__7);

  /* "renpy/display/render.pyx":1043
 * 
 *         if source is self:
 *             raise Exception("Render depends on itself.")             # <<<<<<<<<<<<<<
 * 
 *         self.depends_on_list.append(source)
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Render_depends_on_itself); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "renpy/display/render.pyx":1145
 * 
 *         if self.modal:
 *             focuses[:] = [ ]             # <<<<<<<<<<<<<<
 * 
 *         if self.reverse:
 */
  __pyx_slice__9 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__9);
  __Pyx_GIVEREF(__pyx_slice__9);

  /* "renpy/display/render.pyx":1304
 *                 # Ignore the fixed at the root of every screen.
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth - 1)
 *                 rv.extend(cf[1:])             # <<<<<<<<<<<<<<
 *             else:
 *                 cf = child.main_displayables_at_point(cx, cy, layers, depth)
 */
  __pyx_slice__10 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_slice__10);
  __Pyx_GIVEREF(__pyx_slice__10);

  /* "renpy/display/render.pyx":1369
 *         solid = renpy.display.imagelike.Solid(color)
 *         surf = render(solid, self.width, self.height, 0, 0)
 *         self.blit(surf, (0, 0), focus=False, main=False)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "renpy/display/render.pyx":1381
 *         mutated_surface(surf)
 * 
 *         self.blit(surf, (0, 0))             # <<<<<<<<<<<<<<
 * 
 *         return Canvas(surf)
 */
  __pyx_tuple__12 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "renpy/display/render.pyx":1461
 *             self.forward *= Matrix2D(1.0 / xzoom, 0, 0, 1.0 / yzoom)
 *         else:
 *             self.forward *= Matrix2D(0, 0, 0, 0)             # <<<<<<<<<<<<<<
 * 
 * class Canvas(object):
 */
  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "renpy/display/render.pyx":74
 * models = False
 * 
 * def adjust_render_cache_times(old_time, new_time):             # <<<<<<<<<<<<<<
 *     """
 *     This adjusts the render cache such that if a render starts at
 */
  __pyx_tuple__14 = PyTuple_Pack(11, __pyx_n_s_old_time, __pyx_n_s_new_time, __pyx_n_s_id_d, __pyx_n_s_renders, __pyx_n_s_k, __pyx_n_s_new_renders, __pyx_n_s_v, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_st_base, __pyx_n_s_at_base); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);
  __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_adjust_render_cache_times, 74, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":106
 * 
 * 
 * def free_memory():             # <<<<<<<<<<<<<<
 *     """
 *     Frees memory used by the render system.
 */
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_free_memory, 106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":122
 * 
 * 
 * def check_at_shutdown():             # <<<<<<<<<<<<<<
 *     """
 *     This is called at shutdown time to check that everything went okay.
 */
  __pyx_tuple__17 = PyTuple_Pack(4, __pyx_n_s_l, __pyx_n_s_count, __pyx_n_s_objects, __pyx_n_s_i); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_check_at_shutdown, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":158
 * render_is_ready = 0
 * 
 * def render_ready():             # <<<<<<<<<<<<<<
 *     global render_is_ready
 *     render_is_ready = 1
 */
  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_render_ready, 158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":290
 *     return rv
 * 
 * def render_for_size(d, width, height, st, at):             # <<<<<<<<<<<<<<
 *     """
 *     This returns a render of `d`  that's useful for getting the size or
 */
  __pyx_tuple__20 = PyTuple_Pack(10, __pyx_n_s_d, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_st, __pyx_n_s_at, __pyx_n_s_id_d, __pyx_n_s_orig_wh, __pyx_n_s_render_cache_d, __pyx_n_s_rv, __pyx_n_s_old_sizing); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_render_for_size, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":315
 * 
 * 
 * def invalidate(d):             # <<<<<<<<<<<<<<
 *     """
 *     Removes d from the render cache. If we're not in a redraw, triggers
 */
  __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_d, __pyx_n_s_v); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_invalidate, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":328
 *         v.kill_cache()
 * 
 * def check_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Returns true if a redraw is required, and False otherwise.
 */
  __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_now, __pyx_n_s_when, __pyx_n_s_d, __pyx_n_s_id_d); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_check_redraws, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":349
 *     return False
 * 
 * def process_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Removes any pending redraws from the redraw queue.
 */
  __pyx_tuple__26 = PyTuple_Pack(9, __pyx_n_s_now, __pyx_n_s_rv, __pyx_n_s_new_redraw_queue, __pyx_n_s_seen, __pyx_n_s_t, __pyx_n_s_when, __pyx_n_s_d, __pyx_n_s_id_d, __pyx_n_s_v); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_process_redraws, 349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":396
 * 
 * 
 * def redraw_time():             # <<<<<<<<<<<<<<
 *     """
 *     Returns the time at which the next redraw is scheduled.
 */
  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_redraw_time, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":407
 * 
 * 
 * def redraw(d, when):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */
  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_d, __pyx_n_s_when); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_redraw, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":427
 * 
 * 
 * IDENTITY = Matrix2D(1, 0, 0, 1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__31 = PyTuple_Pack(4, __pyx_int_1, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "renpy/display/render.pyx":431
 * 
 * 
 * def take_focuses(focuses):             # <<<<<<<<<<<<<<
 *     """
 *     Adds a list of rectangular focus regions to the focuses list.
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_n_s_focuses); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_take_focuses, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":445
 * # The result of focus_at_point for a modal render. This overrides any
 * # specific focus from below us.
 * Modal = renpy.object.Sentinel("Modal")             # <<<<<<<<<<<<<<
 * 
 * def focus_at_point(x, y):
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_Modal); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "renpy/display/render.pyx":447
 * Modal = renpy.object.Sentinel("Modal")
 * 
 * def focus_at_point(x, y):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a focus object corresponding to the uppermost displayable
 */
  __pyx_tuple__35 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_cf, __pyx_n_s_d, __pyx_n_s_arg, __pyx_n_s_screen); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_focus_at_point, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":464
 * 
 * 
 * def mutated_surface(surf):             # <<<<<<<<<<<<<<
 *     """
 *     Called to indicate that the given surface has changed.
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_n_s_surf); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_mutated_surface, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":472
 * 
 * 
 * def render_screen(root, width, height):             # <<<<<<<<<<<<<<
 *     """
 *     Renders `root` (a displayable) as the root of a screen with the given
 */
  __pyx_tuple__39 = PyTuple_Pack(6, __pyx_n_s_root, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_interact_time, __pyx_n_s_st, __pyx_n_s_rv); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_render_screen, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":499
 *     return rv
 * 
 * def mark_sweep():             # <<<<<<<<<<<<<<
 *     """
 *     This performs mark-and-sweep garbage collection on the live_renders
 */
  __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_worklist, __pyx_n_s_i, __pyx_n_s_r, __pyx_n_s_j); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);
  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_mark_sweep, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":539
 *     live_renders = worklist
 * 
 * def compute_subline(sx0, sw, cx0, cw):             # <<<<<<<<<<<<<<
 *     """
 *     Given a source line (start sx0, width sw) and a crop line (cx0, cw),
 */
  __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_sx0, __pyx_n_s_sw, __pyx_n_s_cx0, __pyx_n_s_cw, __pyx_n_s_sx1, __pyx_n_s_cx1, __pyx_n_s_start, __pyx_n_s_offset, __pyx_n_s_crop, __pyx_n_s_width); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);
  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_compute_subline, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":1465
 * class Canvas(object):
 * 
 *     def __init__(self, surf): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         self.surf = surf
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_surf); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);
  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_init, 1465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":1468
 *         self.surf = surf
 * 
 *     def rect(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);
  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_rect, 1468, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__49 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "renpy/display/render.pyx":1479
 *             blit_lock.release()
 * 
 *     def polygon(self, color, pointlist, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_pointlist, __pyx_n_s_width); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_polygon, 1479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__52 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "renpy/display/render.pyx":1489
 *             blit_lock.release()
 * 
 *     def circle(self, color, pos, radius, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_pos, __pyx_n_s_radius, __pyx_n_s_width); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);
  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_circle, 1489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__55 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "renpy/display/render.pyx":1502
 *             blit_lock.release()
 * 
 *     def ellipse(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_width); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_ellipse, 1502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__58 = PyTuple_Pack(1, ((PyObject *)__pyx_int_0)); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "renpy/display/render.pyx":1513
 * 
 * 
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_rect, __pyx_n_s_start_angle, __pyx_n_s_stop_angle, __pyx_n_s_width); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);
  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_arc, 1513, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__61 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "renpy/display/render.pyx":1526
 * 
 * 
 *     def line(self, color, start_pos, end_pos, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__62 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_start_pos, __pyx_n_s_end_pos, __pyx_n_s_width); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_line, 1526, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__64 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "renpy/display/render.pyx":1537
 *             blit_lock.release()
 * 
 *     def lines(self, color, closed, pointlist, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_width); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_lines, 1537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__67 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "renpy/display/render.pyx":1548
 *             blit_lock.release()
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__68 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_startpos, __pyx_n_s_endpos, __pyx_n_s_blend); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_aaline, 1548, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__70 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "renpy/display/render.pyx":1559
 *             blit_lock.release()
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_tuple__71 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_color, __pyx_n_s_closed, __pyx_n_s_pointlist, __pyx_n_s_blend); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);
  __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_aalines, 1559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_tuple__73 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "renpy/display/render.pyx":1570
 *             blit_lock.release()
 * 
 *     def get_surface(self):             # <<<<<<<<<<<<<<
 *         return self.surf
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_tom_ab_renpy_renpy_displa, __pyx_n_s_get_surface, 1570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initrender(void); /*proto*/
PyMODINIT_FUNC initrender(void)
#else
PyMODINIT_FUNC PyInit_render(void); /*proto*/
PyMODINIT_FUNC PyInit_render(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_render(void)", 0);
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("render", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_renpy__display__render) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "renpy.display.render")) {
      if (unlikely(PyDict_SetItemString(modules, "renpy.display.render", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_5renpy_7display_6render_live_renders = ((PyObject*)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("render", (void (*)(void))__pyx_f_5renpy_7display_6render_render, "PyObject *(PyObject *, PyObject *, PyObject *, double, double, int __pyx_skip_dispatch)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Type init code ---*/
  __pyx_vtabptr_5renpy_7display_6render_Render = &__pyx_vtable_5renpy_7display_6render_Render;
  __pyx_vtable_5renpy_7display_6render_Render.blit = (int (*)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_blit *__pyx_optional_args))__pyx_f_5renpy_7display_6render_6Render_blit;
  __pyx_vtable_5renpy_7display_6render_Render.subpixel_blit = (int (*)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_subpixel_blit *__pyx_optional_args))__pyx_f_5renpy_7display_6render_6Render_subpixel_blit;
  __pyx_vtable_5renpy_7display_6render_Render.absolute_blit = (int (*)(struct __pyx_obj_5renpy_7display_6render_Render *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5renpy_7display_6render_6Render_absolute_blit *__pyx_optional_args))__pyx_f_5renpy_7display_6render_6Render_absolute_blit;
  if (PyType_Ready(&__pyx_type_5renpy_7display_6render_Render) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_5renpy_7display_6render_Render.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5renpy_7display_6render_Render, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_5renpy_7display_6render_6Render___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_5renpy_7display_6render_6Render___init__.doc = __pyx_doc_5renpy_7display_6render_6Render___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5renpy_7display_6render_6Render___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_5renpy_7display_6render_Render.tp_dict, __pyx_vtabptr_5renpy_7display_6render_Render) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "Render", (PyObject *)&__pyx_type_5renpy_7display_6render_Render) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_7display_6render_Render = &__pyx_type_5renpy_7display_6render_Render;
  /*--- Type import code ---*/
  __pyx_ptype_5renpy_7display_6matrix_Matrix = __Pyx_ImportType("renpy.display.matrix", "Matrix", sizeof(struct __pyx_obj_5renpy_7display_6matrix_Matrix), 1); if (unlikely(!__pyx_ptype_5renpy_7display_6matrix_Matrix)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_7display_6matrix_Matrix = (struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix*)__Pyx_GetVtable(__pyx_ptype_5renpy_7display_6matrix_Matrix->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_7display_6matrix_Matrix)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5renpy_7display_6matrix_Matrix2D = __Pyx_ImportType("renpy.display.matrix", "Matrix2D", sizeof(struct __pyx_obj_5renpy_7display_6matrix_Matrix2D), 1); if (unlikely(!__pyx_ptype_5renpy_7display_6matrix_Matrix2D)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_5renpy_7display_6matrix_Matrix2D = (struct __pyx_vtabstruct_5renpy_7display_6matrix_Matrix2D*)__Pyx_GetVtable(__pyx_ptype_5renpy_7display_6matrix_Matrix2D->tp_dict); if (unlikely(!__pyx_vtabptr_5renpy_7display_6matrix_Matrix2D)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "renpy/display/render.pyx":25
 * from __future__ import print_function
 * 
 * from renpy.display.matrix import Matrix, Matrix2D             # <<<<<<<<<<<<<<
 * from renpy.display.matrix cimport Matrix, Matrix2D
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Matrix);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Matrix);
  __Pyx_GIVEREF(__pyx_n_s_Matrix);
  __Pyx_INCREF(__pyx_n_s_Matrix2D);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_Matrix2D);
  __Pyx_GIVEREF(__pyx_n_s_Matrix2D);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_renpy_display_matrix, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":30
 * # This is required to get these to re-export despite having been defined
 * # in cython.
 * globals()["Matrix"] = Matrix             # <<<<<<<<<<<<<<
 * globals()["Matrix2D"] = Matrix2D
 * 
 */
  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_Matrix, ((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix))) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":31
 * # in cython.
 * globals()["Matrix"] = Matrix
 * globals()["Matrix2D"] = Matrix2D             # <<<<<<<<<<<<<<
 * 
 * import collections
 */
  __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_Matrix2D, ((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix2D))) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":33
 * globals()["Matrix2D"] = Matrix2D
 * 
 * import collections             # <<<<<<<<<<<<<<
 * import pygame_sdl2 as pygame
 * import threading
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":34
 * 
 * import collections
 * import pygame_sdl2 as pygame             # <<<<<<<<<<<<<<
 * import threading
 * import renpy
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pygame_sdl2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pygame, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":35
 * import collections
 * import pygame_sdl2 as pygame
 * import threading             # <<<<<<<<<<<<<<
 * import renpy
 * import gc
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":36
 * import pygame_sdl2 as pygame
 * import threading
 * import renpy             # <<<<<<<<<<<<<<
 * import gc
 * import math
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_renpy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_renpy, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":37
 * import threading
 * import renpy
 * import gc             # <<<<<<<<<<<<<<
 * import math
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gc, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":38
 * import renpy
 * import gc
 * import math             # <<<<<<<<<<<<<<
 * 
 * # We grab the blit lock each time it is necessary to blit
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_math, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_math, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":43
 * # something. This allows call to the pygame.transform functions to
 * # disable blitting, should it prove necessary.
 * blit_lock = threading.Condition()             # <<<<<<<<<<<<<<
 * 
 * # This is a dictionary containing all the renders that we know of. It's a
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Condition); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_blit_lock, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":48
 * # map from displayable to dictionaries containing the render of that
 * # displayable.
 * render_cache = collections.defaultdict(dict)             # <<<<<<<<<<<<<<
 * 
 * # The queue of redraws. A list of (time, displayable) pairs.
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_collections); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)((PyObject*)(&PyDict_Type)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyDict_Type))));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)((PyObject*)(&PyDict_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyDict_Type))));
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_cache, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":51
 * 
 * # The queue of redraws. A list of (time, displayable) pairs.
 * redraw_queue = [ ]             # <<<<<<<<<<<<<<
 * 
 * # The render returned from render_screen.
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_redraw_queue, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":54
 * 
 * # The render returned from render_screen.
 * screen_render = None             # <<<<<<<<<<<<<<
 * 
 * # A list of renders the system knows about, and thinks are still alive.
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_screen_render, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":58
 * # A list of renders the system knows about, and thinks are still alive.
 * cdef list live_renders
 * live_renders = [ ]             # <<<<<<<<<<<<<<
 * 
 * # A copy of renpy.display.interface.frame_time, for speed reasons.
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(__pyx_v_5renpy_7display_6render_live_renders);
  __Pyx_DECREF_SET(__pyx_v_5renpy_7display_6render_live_renders, ((PyObject*)__pyx_t_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":62
 * # A copy of renpy.display.interface.frame_time, for speed reasons.
 * cdef double frame_time
 * frame_time = 0             # <<<<<<<<<<<<<<
 * 
 * # Are we doing a per_frame update?
 */
  __pyx_v_5renpy_7display_6render_frame_time = 0.0;

  /* "renpy/display/render.pyx":65
 * 
 * # Are we doing a per_frame update?
 * per_frame = False             # <<<<<<<<<<<<<<
 * 
 * # Are we rendering for the purpose of sizing something.
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_per_frame, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":68
 * 
 * # Are we rendering for the purpose of sizing something.
 * sizing = False             # <<<<<<<<<<<<<<
 * 
 * # This is true if we're using a renderer that supports models,
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sizing, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":72
 * # This is true if we're using a renderer that supports models,
 * # false otherwise.
 * models = False             # <<<<<<<<<<<<<<
 * 
 * def adjust_render_cache_times(old_time, new_time):
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_models, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":74
 * models = False
 * 
 * def adjust_render_cache_times(old_time, new_time):             # <<<<<<<<<<<<<<
 *     """
 *     This adjusts the render cache such that if a render starts at
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_1adjust_render_cache_times, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_adjust_render_cache_times, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":106
 * 
 * 
 * def free_memory():             # <<<<<<<<<<<<<<
 *     """
 *     Frees memory used by the render system.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_3free_memory, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_free_memory, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":122
 * 
 * 
 * def check_at_shutdown():             # <<<<<<<<<<<<<<
 *     """
 *     This is called at shutdown time to check that everything went okay.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_5check_at_shutdown, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_at_shutdown, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":149
 * # The number of things being rendered at the moment.
 * cdef int rendering
 * rendering = 0             # <<<<<<<<<<<<<<
 * 
 * # The st and at of the current call to render.
 */
  __pyx_v_5renpy_7display_6render_rendering = 0;

  /* "renpy/display/render.pyx":152
 * 
 * # The st and at of the current call to render.
 * render_st = 0.0             # <<<<<<<<<<<<<<
 * render_at = 0.0
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_st, __pyx_float_0_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":153
 * # The st and at of the current call to render.
 * render_st = 0.0
 * render_at = 0.0             # <<<<<<<<<<<<<<
 * 
 * cdef bint render_is_ready
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_at, __pyx_float_0_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":156
 * 
 * cdef bint render_is_ready
 * render_is_ready = 0             # <<<<<<<<<<<<<<
 * 
 * def render_ready():
 */
  __pyx_v_5renpy_7display_6render_render_is_ready = 0;

  /* "renpy/display/render.pyx":158
 * render_is_ready = 0
 * 
 * def render_ready():             # <<<<<<<<<<<<<<
 *     global render_is_ready
 *     render_is_ready = 1
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_7render_ready, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_ready, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":163
 * 
 * # These are good until the next call to render.
 * render_width = 0             # <<<<<<<<<<<<<<
 * render_height = 0
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_width, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":164
 * # These are good until the next call to render.
 * render_width = 0
 * render_height = 0             # <<<<<<<<<<<<<<
 * 
 * cpdef render(d, object widtho, object heighto, double st, double at):
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_height, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":290
 *     return rv
 * 
 * def render_for_size(d, width, height, st, at):             # <<<<<<<<<<<<<<
 *     """
 *     This returns a render of `d`  that's useful for getting the size or
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_11render_for_size, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_for_size, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":315
 * 
 * 
 * def invalidate(d):             # <<<<<<<<<<<<<<
 *     """
 *     Removes d from the render cache. If we're not in a redraw, triggers
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_13invalidate, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_invalidate, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":328
 *         v.kill_cache()
 * 
 * def check_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Returns true if a redraw is required, and False otherwise.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_15check_redraws, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_redraws, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":349
 *     return False
 * 
 * def process_redraws():             # <<<<<<<<<<<<<<
 *     """
 *     Removes any pending redraws from the redraw queue.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_17process_redraws, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_process_redraws, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":396
 * 
 * 
 * def redraw_time():             # <<<<<<<<<<<<<<
 *     """
 *     Returns the time at which the next redraw is scheduled.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_19redraw_time, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_redraw_time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":407
 * 
 * 
 * def redraw(d, when):             # <<<<<<<<<<<<<<
 *     """
 *     :doc: udd_utility
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_21redraw, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_redraw, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":427
 * 
 * 
 * IDENTITY = Matrix2D(1, 0, 0, 1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5renpy_7display_6matrix_Matrix2D)), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDENTITY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":431
 * 
 * 
 * def take_focuses(focuses):             # <<<<<<<<<<<<<<
 *     """
 *     Adds a list of rectangular focus regions to the focuses list.
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_23take_focuses, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_focuses, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "renpy/display/render.pyx":445
 * # The result of focus_at_point for a modal render. This overrides any
 * # specific focus from below us.
 * Modal = renpy.object.Sentinel("Modal")             # <<<<<<<<<<<<<<
 * 
 * def focus_at_point(x, y):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_renpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Sentinel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Modal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":447
 * Modal = renpy.object.Sentinel("Modal")
 * 
 * def focus_at_point(x, y):             # <<<<<<<<<<<<<<
 *     """
 *     Returns a focus object corresponding to the uppermost displayable
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_25focus_at_point, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_focus_at_point, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":464
 * 
 * 
 * def mutated_surface(surf):             # <<<<<<<<<<<<<<
 *     """
 *     Called to indicate that the given surface has changed.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_27mutated_surface, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mutated_surface, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":472
 * 
 * 
 * def render_screen(root, width, height):             # <<<<<<<<<<<<<<
 *     """
 *     Renders `root` (a displayable) as the root of a screen with the given
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_29render_screen, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_render_screen, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":499
 *     return rv
 * 
 * def mark_sweep():             # <<<<<<<<<<<<<<
 *     """
 *     This performs mark-and-sweep garbage collection on the live_renders
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_31mark_sweep, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_mark_sweep, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":539
 *     live_renders = worklist
 * 
 * def compute_subline(sx0, sw, cx0, cw):             # <<<<<<<<<<<<<<
 *     """
 *     Given a source line (start sx0, width sw) and a crop line (cx0, cw),
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_33compute_subline, NULL, __pyx_n_s_renpy_display_render); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_subline, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":573
 * 
 * # Possible operations that can be done as part of a render.
 * BLIT = 0             # <<<<<<<<<<<<<<
 * DISSOLVE = 1
 * IMAGEDISSOLVE = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BLIT, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":574
 * # Possible operations that can be done as part of a render.
 * BLIT = 0
 * DISSOLVE = 1             # <<<<<<<<<<<<<<
 * IMAGEDISSOLVE = 2
 * PIXELLATE = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DISSOLVE, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":575
 * BLIT = 0
 * DISSOLVE = 1
 * IMAGEDISSOLVE = 2             # <<<<<<<<<<<<<<
 * PIXELLATE = 3
 * FLATTEN = 4
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IMAGEDISSOLVE, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":576
 * DISSOLVE = 1
 * IMAGEDISSOLVE = 2
 * PIXELLATE = 3             # <<<<<<<<<<<<<<
 * FLATTEN = 4
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PIXELLATE, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":577
 * IMAGEDISSOLVE = 2
 * PIXELLATE = 3
 * FLATTEN = 4             # <<<<<<<<<<<<<<
 * 
 * cdef class Render:
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FLATTEN, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "renpy/display/render.pyx":862
 *         return rv
 * 
 *     pygame_surface = render_to_texture             # <<<<<<<<<<<<<<
 * 
 *     def subsurface(self, rect, focus=False):
 */
  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_5renpy_7display_6render_Render, __pyx_n_s_render_to_texture); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_5renpy_7display_6render_Render->tp_dict, __pyx_n_s_pygame_surface, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_5renpy_7display_6render_Render);

  /* "renpy/display/render.pyx":1463
 *             self.forward *= Matrix2D(0, 0, 0, 0)
 * 
 * class Canvas(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, surf): #@DuplicatedSignature
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Canvas, __pyx_n_s_Canvas, (PyObject *) NULL, __pyx_n_s_renpy_display_render, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);

  /* "renpy/display/render.pyx":1465
 * class Canvas(object):
 * 
 *     def __init__(self, surf): #@DuplicatedSignature             # <<<<<<<<<<<<<<
 *         self.surf = surf
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_1__init__, 0, __pyx_n_s_Canvas___init, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1468
 *         self.surf = surf
 * 
 *     def rect(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_3rect, 0, __pyx_n_s_Canvas_rect, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__49);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_rect, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1479
 *             blit_lock.release()
 * 
 *     def polygon(self, color, pointlist, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_5polygon, 0, __pyx_n_s_Canvas_polygon, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__52);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_polygon, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1489
 *             blit_lock.release()
 * 
 *     def circle(self, color, pos, radius, width=0):             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_7circle, 0, __pyx_n_s_Canvas_circle, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__55);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_circle, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1502
 *             blit_lock.release()
 * 
 *     def ellipse(self, color, rect, width=0):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_9ellipse, 0, __pyx_n_s_Canvas_ellipse, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__58);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_ellipse, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1513
 * 
 * 
 *     def arc(self, color, rect, start_angle, stop_angle, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_11arc, 0, __pyx_n_s_Canvas_arc, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__61);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_arc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1526
 * 
 * 
 *     def line(self, color, start_pos, end_pos, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_13line, 0, __pyx_n_s_Canvas_line, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__64);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_line, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1537
 *             blit_lock.release()
 * 
 *     def lines(self, color, closed, pointlist, width=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_15lines, 0, __pyx_n_s_Canvas_lines, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__67);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_lines, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1548
 *             blit_lock.release()
 * 
 *     def aaline(self, color, startpos, endpos, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_17aaline, 0, __pyx_n_s_Canvas_aaline, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__70);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_aaline, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1559
 *             blit_lock.release()
 * 
 *     def aalines(self, color, closed, pointlist, blend=1):             # <<<<<<<<<<<<<<
 *         try:
 *             blit_lock.acquire()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_19aalines, 0, __pyx_n_s_Canvas_aalines, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__73);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_aalines, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1570
 *             blit_lock.release()
 * 
 *     def get_surface(self):             # <<<<<<<<<<<<<<
 *         return self.surf
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5renpy_7display_6render_6Canvas_21get_surface, 0, __pyx_n_s_Canvas_get_surface, NULL, __pyx_n_s_renpy_display_render, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyObject_SetItem(__pyx_t_4, __pyx_n_s_get_surface, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "renpy/display/render.pyx":1463
 *             self.forward *= Matrix2D(0, 0, 0, 0)
 * 
 * class Canvas(object):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, surf): #@DuplicatedSignature
 */
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Canvas, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Canvas, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/render.pyx":1
 * #cython: profile=False             # <<<<<<<<<<<<<<
 * # Copyright 2004-2019 Tom Rothamel <pytom@bishoujo.us>
 * #
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "renpy/display/matrix.pxd":37
 *         oz[0] = x * self.zdx + y * self.zdy + z * self.zdz + w * self.zdw
 * 
 *     cdef inline void transform2(Matrix self, float *ox, float *oy, float x, float y, float z, float w):             # <<<<<<<<<<<<<<
 *         ox[0] = x * self.xdx + y * self.xdy + z * self.xdz + w * self.xdw
 *         oy[0] = x * self.ydx + y * self.ydy + z * self.ydz + w * self.ydw
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init renpy.display.render", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init renpy.display.render");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject* args = PyTuple_Pack(1, arg);
    return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
}
#endif

static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                if (PyObject_IsSubclass(instance_class, type)) {
                    type = instance_class;
                } else {
                    instance_class = NULL;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(tmp_type, tmp_value, tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get, key, default_value, NULL);
    }
#endif
    return value;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
        PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_ass_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (PyErr_ExceptionMatches(PyExc_OverflowError))
                    PyErr_Clear();
                else
                    goto bad;
            }
        }
        return ms->sq_ass_slice(obj, cstart, cstop, value);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_ass_subscript))
#endif
    {
        int result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_COMPILING_IN_CPYTHON
        result = mp->mp_ass_subscript(obj, py_slice, value);
#else
        result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object does not support slice %.10s",
        Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
bad:
    return -1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static PyObject* __Pyx_Globals(void) {
    Py_ssize_t i;
    PyObject *names;
    PyObject *globals = __pyx_d;
    Py_INCREF(globals);
    names = PyObject_Dir(__pyx_m);
    if (!names)
        goto bad;
    for (i = PyList_GET_SIZE(names)-1; i >= 0; i--) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject* name = PySequence_GetItem(names, i);
        if (!name)
            goto bad;
#else
        PyObject* name = PyList_GET_ITEM(names, i);
#endif
        if (!PyDict_Contains(globals, name)) {
            PyObject* value = __Pyx_GetAttr(__pyx_m, name);
            if (!value) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                goto bad;
            }
            if (PyDict_SetItem(globals, name, value) < 0) {
#if CYTHON_COMPILING_IN_PYPY
                Py_DECREF(name);
#endif
                Py_DECREF(value);
                goto bad;
            }
        }
#if CYTHON_COMPILING_IN_PYPY
        Py_DECREF(name);
#endif
    }
    Py_DECREF(names);
    return globals;
bad:
    Py_XDECREF(names);
    Py_XDECREF(globals);
    return NULL;
}

static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result)
        result = __Pyx_GetModuleGlobalName(name);
    return result;
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    Py_DECREF(res);
    return 0;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
#ifndef PY_WRITE_RESTRICTED
#define PY_WRITE_RESTRICTED WRITE_RESTRICTED
#endif
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    Py_ssize_t size;
    switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
    case METH_VARARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0)
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 0)
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
            size = PyTuple_GET_SIZE(arg);
            if (size == 1)
                return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%zd given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __Pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = (start + end) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)       \
    {                                                                     \
        func_type value = func_value;                                     \
        if (sizeof(target_type) < sizeof(func_type)) {                    \
            if (unlikely(value != (func_type) (target_type) value)) {     \
                func_type zero = 0;                                       \
                if (is_unsigned && unlikely(value < zero))                \
                    goto raise_neg_overflow;                              \
                else                                                      \
                    goto raise_overflow;                                  \
            }                                                             \
        }                                                                 \
        return (target_type) value;                                       \
    }

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
 #endif
#endif

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned long long)) {
            return PyLong_FromUnsignedLongLong((unsigned long long) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(long long)) {
            return PyLong_FromLongLong((long long) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned long long)) {
                __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
 #if CYTHON_USE_PYLONG_INTERNALS
            switch (Py_SIZE(x)) {
                case  0: return 0;
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +(((PyLongObject*)x)->ob_digit[0]));
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
            }
 #endif
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(long long)) {
                __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;
    union {
        void (*fp)(void);
        void *p;
    } tmp;
    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(tmp.p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if !CYTHON_COMPILING_IN_PYPY
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b)))
      return PyInt_AS_LONG(b);
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
     #if CYTHON_USE_PYLONG_INTERNALS
       switch (Py_SIZE(b)) {
       case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
       case  0: return 0;
       case  1: return ((PyLongObject*)b)->ob_digit[0];
       }
     #endif
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
