caryclark@google.com | 411bb72 | 2012-11-06 21:29:16 +0000 | [diff] [blame] | 1 | /* |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 2 | * Copyright 2012 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef PictureRenderer_DEFINED |
| 9 | #define PictureRenderer_DEFINED |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 10 | |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 11 | #include "SkCanvas.h" |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 12 | #include "SkCountdown.h" |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 13 | #include "SkDrawFilter.h" |
commit-bot@chromium.org | a3f882c | 2013-12-13 20:52:36 +0000 | [diff] [blame] | 14 | #include "SkJSONCPP.h" |
keyar@chromium.org | f4959ab | 2012-08-23 20:53:25 +0000 | [diff] [blame] | 15 | #include "SkMath.h" |
reed@google.com | ea6a306 | 2012-11-06 22:14:54 +0000 | [diff] [blame] | 16 | #include "SkPaint.h" |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 17 | #include "SkPicture.h" |
scroggo@google.com | acfb30e | 2012-09-18 14:32:35 +0000 | [diff] [blame] | 18 | #include "SkRect.h" |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 19 | #include "SkRefCnt.h" |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 20 | #include "SkRunnable.h" |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 21 | #include "SkString.h" |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 22 | #include "SkTDArray.h" |
| 23 | #include "SkThreadPool.h" |
junov@chromium.org | 29b19e5 | 2013-02-27 18:35:16 +0000 | [diff] [blame] | 24 | #include "SkTileGridPicture.h" |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 25 | #include "SkTypes.h" |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 26 | |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 27 | #if SK_SUPPORT_GPU |
| 28 | #include "GrContextFactory.h" |
| 29 | #include "GrContext.h" |
| 30 | #endif |
| 31 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 32 | class SkBitmap; |
| 33 | class SkCanvas; |
robertphillips@google.com | 6177e69 | 2013-02-28 20:16:25 +0000 | [diff] [blame] | 34 | class SkGLContextHelper; |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 35 | class SkThread; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 36 | |
| 37 | namespace sk_tools { |
| 38 | |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 39 | class TiledPictureRenderer; |
| 40 | |
commit-bot@chromium.org | a3f882c | 2013-12-13 20:52:36 +0000 | [diff] [blame] | 41 | /** |
| 42 | * Class for collecting image results (checksums) as we go. |
| 43 | */ |
| 44 | class ImageResultsSummary { |
| 45 | public: |
| 46 | /** |
| 47 | * Adds this bitmap's hash to the summary of results. |
| 48 | * |
| 49 | * @param testName name of the test |
| 50 | * @param bitmap bitmap to store the hash of |
| 51 | */ |
| 52 | void add(const char *testName, const SkBitmap& bitmap); |
| 53 | |
| 54 | /** |
| 55 | * Writes the summary (as constructed so far) to a file. |
| 56 | * |
| 57 | * @param filename path to write the summary to |
| 58 | */ |
| 59 | void writeToFile(const char *filename); |
| 60 | |
| 61 | private: |
| 62 | Json::Value fActualResultsNoComparison; |
| 63 | }; |
| 64 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 65 | class PictureRenderer : public SkRefCnt { |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 66 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 67 | public: |
keyar@chromium.org | c81686c | 2012-08-20 15:04:04 +0000 | [diff] [blame] | 68 | enum SkDeviceTypes { |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 69 | #if SK_ANGLE |
| 70 | kAngle_DeviceType, |
| 71 | #endif |
rmistry@google.com | 6ab9673 | 2014-01-06 18:37:24 +0000 | [diff] [blame] | 72 | #if SK_MESA |
| 73 | kMesa_DeviceType, |
| 74 | #endif |
keyar@chromium.org | c81686c | 2012-08-20 15:04:04 +0000 | [diff] [blame] | 75 | kBitmap_DeviceType, |
| 76 | #if SK_SUPPORT_GPU |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 77 | kGPU_DeviceType, |
keyar@chromium.org | c81686c | 2012-08-20 15:04:04 +0000 | [diff] [blame] | 78 | #endif |
| 79 | }; |
| 80 | |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 81 | enum BBoxHierarchyType { |
| 82 | kNone_BBoxHierarchyType = 0, |
commit-bot@chromium.org | c22d139 | 2014-02-03 18:08:33 +0000 | [diff] [blame^] | 83 | kQuadTree_BBoxHierarchyType, |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 84 | kRTree_BBoxHierarchyType, |
junov@chromium.org | 7b53706 | 2012-11-06 18:58:43 +0000 | [diff] [blame] | 85 | kTileGrid_BBoxHierarchyType, |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 86 | }; |
| 87 | |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 88 | // this uses SkPaint::Flags as a base and adds additional flags |
| 89 | enum DrawFilterFlags { |
| 90 | kNone_DrawFilterFlag = 0, |
reed@google.com | 881b10b | 2013-05-22 14:03:45 +0000 | [diff] [blame] | 91 | kHinting_DrawFilterFlag = 0x10000, // toggles between no hinting and normal hinting |
| 92 | kSlightHinting_DrawFilterFlag = 0x20000, // toggles between slight and normal hinting |
| 93 | kAAClip_DrawFilterFlag = 0x40000, // toggles between soft and hard clip |
humper@google.com | 387db0a | 2013-07-09 14:13:04 +0000 | [diff] [blame] | 94 | kMaskFilter_DrawFilterFlag = 0x80000, // toggles on/off mask filters (e.g., blurs) |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 95 | }; |
| 96 | |
robertphillips@google.com | 4914931 | 2013-07-03 15:34:35 +0000 | [diff] [blame] | 97 | SK_COMPILE_ASSERT(!(kMaskFilter_DrawFilterFlag & SkPaint::kAllFlags), maskfilter_flag_must_be_greater); |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 98 | SK_COMPILE_ASSERT(!(kHinting_DrawFilterFlag & SkPaint::kAllFlags), |
| 99 | hinting_flag_must_be_greater); |
| 100 | SK_COMPILE_ASSERT(!(kSlightHinting_DrawFilterFlag & SkPaint::kAllFlags), |
| 101 | slight_hinting_flag_must_be_greater); |
| 102 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 103 | /** |
| 104 | * Called with each new SkPicture to render. |
| 105 | */ |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 106 | virtual void init(SkPicture* pict); |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 107 | |
| 108 | /** |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 109 | * Set the viewport so that only the portion listed gets drawn. |
| 110 | */ |
| 111 | void setViewport(SkISize size) { fViewport = size; } |
| 112 | |
| 113 | /** |
scroggo@google.com | 82ec0b0 | 2012-12-17 19:25:54 +0000 | [diff] [blame] | 114 | * Set the scale factor at which draw the picture. |
| 115 | */ |
| 116 | void setScaleFactor(SkScalar scale) { fScaleFactor = scale; } |
| 117 | |
| 118 | /** |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 119 | * Perform any setup that should done prior to each iteration of render() which should not be |
| 120 | * timed. |
| 121 | */ |
| 122 | virtual void setup() {} |
| 123 | |
| 124 | /** |
| 125 | * Perform work that is to be timed. Typically this is rendering, but is also used for recording |
| 126 | * and preparing picture for playback by the subclasses which do those. |
scroggo@google.com | 81f9d2e | 2012-09-20 14:54:21 +0000 | [diff] [blame] | 127 | * If path is non-null, subclass implementations should call write(). |
| 128 | * @param path If non-null, also write the output to the file specified by path. path should |
| 129 | * have no extension; it will be added by write(). |
borenet@google.com | 070d354 | 2012-10-26 13:26:55 +0000 | [diff] [blame] | 130 | * @return bool True if rendering succeeded and, if path is non-null, the output was |
| 131 | * successfully written to a file. |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 132 | */ |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 133 | virtual bool render(const SkString* path, SkBitmap** out = NULL) = 0; |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 134 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 135 | /** |
| 136 | * Called once finished with a particular SkPicture, before calling init again, and before |
| 137 | * being done with this Renderer. |
| 138 | */ |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 139 | virtual void end(); |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 140 | |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 141 | /** |
| 142 | * If this PictureRenderer is actually a TiledPictureRender, return a pointer to this as a |
| 143 | * TiledPictureRender so its methods can be called. |
| 144 | */ |
| 145 | virtual TiledPictureRenderer* getTiledRenderer() { return NULL; } |
| 146 | |
scroggo@google.com | 08085f8 | 2013-01-28 20:40:24 +0000 | [diff] [blame] | 147 | /** |
| 148 | * Resets the GPU's state. Does nothing if the backing is raster. For a GPU renderer, calls |
| 149 | * flush, and calls finish if callFinish is true. |
| 150 | * @param callFinish Whether to call finish. |
| 151 | */ |
| 152 | void resetState(bool callFinish); |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 153 | |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 154 | /** |
robertphillips@google.com | 94d8f1e | 2013-12-18 17:25:33 +0000 | [diff] [blame] | 155 | * Remove all decoded textures from the CPU caches and all uploaded textures |
| 156 | * from the GPU. |
| 157 | */ |
| 158 | void purgeTextures(); |
| 159 | |
| 160 | /** |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 161 | * Set the backend type. Returns true on success and false on failure. |
| 162 | */ |
| 163 | bool setDeviceType(SkDeviceTypes deviceType) { |
keyar@chromium.org | c81686c | 2012-08-20 15:04:04 +0000 | [diff] [blame] | 164 | fDeviceType = deviceType; |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 165 | #if SK_SUPPORT_GPU |
| 166 | // In case this function is called more than once |
| 167 | SkSafeUnref(fGrContext); |
| 168 | fGrContext = NULL; |
| 169 | // Set to Native so it will have an initial value. |
| 170 | GrContextFactory::GLContextType glContextType = GrContextFactory::kNative_GLContextType; |
| 171 | #endif |
| 172 | switch(deviceType) { |
| 173 | case kBitmap_DeviceType: |
| 174 | return true; |
| 175 | #if SK_SUPPORT_GPU |
| 176 | case kGPU_DeviceType: |
| 177 | // Already set to GrContextFactory::kNative_GLContextType, above. |
| 178 | break; |
| 179 | #if SK_ANGLE |
| 180 | case kAngle_DeviceType: |
| 181 | glContextType = GrContextFactory::kANGLE_GLContextType; |
| 182 | break; |
| 183 | #endif |
rmistry@google.com | 6ab9673 | 2014-01-06 18:37:24 +0000 | [diff] [blame] | 184 | #if SK_MESA |
| 185 | case kMesa_DeviceType: |
| 186 | glContextType = GrContextFactory::kMESA_GLContextType; |
| 187 | break; |
| 188 | #endif |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 189 | #endif |
| 190 | default: |
| 191 | // Invalid device type. |
| 192 | return false; |
| 193 | } |
| 194 | #if SK_SUPPORT_GPU |
| 195 | fGrContext = fGrContextFactory.get(glContextType); |
| 196 | if (NULL == fGrContext) { |
| 197 | return false; |
| 198 | } else { |
| 199 | fGrContext->ref(); |
| 200 | return true; |
| 201 | } |
| 202 | #endif |
keyar@chromium.org | fe6391a | 2012-08-20 15:03:41 +0000 | [diff] [blame] | 203 | } |
| 204 | |
jvanverth@google.com | f6a9033 | 2013-05-02 12:39:37 +0000 | [diff] [blame] | 205 | #if SK_SUPPORT_GPU |
| 206 | void setSampleCount(int sampleCount) { |
| 207 | fSampleCount = sampleCount; |
| 208 | } |
| 209 | #endif |
| 210 | |
caryclark@google.com | e3e940c | 2012-11-07 16:42:17 +0000 | [diff] [blame] | 211 | void setDrawFilters(DrawFilterFlags const * const filters, const SkString& configName) { |
| 212 | memcpy(fDrawFilters, filters, sizeof(fDrawFilters)); |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 213 | fDrawFiltersConfig = configName; |
| 214 | } |
| 215 | |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 216 | void setBBoxHierarchyType(BBoxHierarchyType bbhType) { |
| 217 | fBBoxHierarchyType = bbhType; |
| 218 | } |
| 219 | |
junov@chromium.org | e286e84 | 2013-03-13 17:27:16 +0000 | [diff] [blame] | 220 | BBoxHierarchyType getBBoxHierarchyType() { return fBBoxHierarchyType; } |
| 221 | |
junov@chromium.org | 7b53706 | 2012-11-06 18:58:43 +0000 | [diff] [blame] | 222 | void setGridSize(int width, int height) { |
junov@chromium.org | 29b19e5 | 2013-02-27 18:35:16 +0000 | [diff] [blame] | 223 | fGridInfo.fTileInterval.set(width, height); |
junov@chromium.org | 7b53706 | 2012-11-06 18:58:43 +0000 | [diff] [blame] | 224 | } |
| 225 | |
commit-bot@chromium.org | a3f882c | 2013-12-13 20:52:36 +0000 | [diff] [blame] | 226 | void setJsonSummaryPtr(ImageResultsSummary* jsonSummaryPtr) { |
| 227 | fJsonSummaryPtr = jsonSummaryPtr; |
| 228 | } |
| 229 | |
keyar@chromium.org | fe6391a | 2012-08-20 15:03:41 +0000 | [diff] [blame] | 230 | bool isUsingBitmapDevice() { |
keyar@chromium.org | 78a35c5 | 2012-08-20 15:03:44 +0000 | [diff] [blame] | 231 | return kBitmap_DeviceType == fDeviceType; |
keyar@chromium.org | 4ea96c5 | 2012-08-20 15:03:29 +0000 | [diff] [blame] | 232 | } |
| 233 | |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 234 | virtual SkString getPerIterTimeFormat() { return SkString("%.2f"); } |
| 235 | |
| 236 | virtual SkString getNormalTimeFormat() { return SkString("%6.2f"); } |
| 237 | |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 238 | /** |
| 239 | * Reports the configuration of this PictureRenderer. |
| 240 | */ |
| 241 | SkString getConfigName() { |
| 242 | SkString config = this->getConfigNameInternal(); |
scroggo@google.com | c4013c1 | 2012-12-13 22:07:08 +0000 | [diff] [blame] | 243 | if (!fViewport.isEmpty()) { |
| 244 | config.appendf("_viewport_%ix%i", fViewport.width(), fViewport.height()); |
| 245 | } |
commit-bot@chromium.org | 9de35eb | 2013-12-20 21:49:33 +0000 | [diff] [blame] | 246 | if (fScaleFactor != SK_Scalar1) { |
| 247 | config.appendf("_scalar_%f", SkScalarToFloat(fScaleFactor)); |
| 248 | } |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 249 | if (kRTree_BBoxHierarchyType == fBBoxHierarchyType) { |
| 250 | config.append("_rtree"); |
commit-bot@chromium.org | c22d139 | 2014-02-03 18:08:33 +0000 | [diff] [blame^] | 251 | } else if (kQuadTree_BBoxHierarchyType == fBBoxHierarchyType) { |
| 252 | config.append("_quadtree"); |
junov@chromium.org | 7b53706 | 2012-11-06 18:58:43 +0000 | [diff] [blame] | 253 | } else if (kTileGrid_BBoxHierarchyType == fBBoxHierarchyType) { |
| 254 | config.append("_grid"); |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 255 | } |
| 256 | #if SK_SUPPORT_GPU |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 257 | switch (fDeviceType) { |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 258 | case kGPU_DeviceType: |
jvanverth@google.com | f6a9033 | 2013-05-02 12:39:37 +0000 | [diff] [blame] | 259 | if (fSampleCount) { |
| 260 | config.appendf("_msaa%d", fSampleCount); |
| 261 | } else { |
| 262 | config.append("_gpu"); |
| 263 | } |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 264 | break; |
| 265 | #if SK_ANGLE |
| 266 | case kAngle_DeviceType: |
| 267 | config.append("_angle"); |
| 268 | break; |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 269 | #endif |
rmistry@google.com | 6ab9673 | 2014-01-06 18:37:24 +0000 | [diff] [blame] | 270 | #if SK_MESA |
| 271 | case kMesa_DeviceType: |
| 272 | config.append("_mesa"); |
| 273 | break; |
| 274 | #endif |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 275 | default: |
| 276 | // Assume that no extra info means bitmap. |
| 277 | break; |
| 278 | } |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 279 | #endif |
caryclark@google.com | a362237 | 2012-11-06 21:26:13 +0000 | [diff] [blame] | 280 | config.append(fDrawFiltersConfig.c_str()); |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 281 | return config; |
| 282 | } |
| 283 | |
keyar@chromium.org | 4ea96c5 | 2012-08-20 15:03:29 +0000 | [diff] [blame] | 284 | #if SK_SUPPORT_GPU |
keyar@chromium.org | fe6391a | 2012-08-20 15:03:41 +0000 | [diff] [blame] | 285 | bool isUsingGpuDevice() { |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 286 | switch (fDeviceType) { |
| 287 | case kGPU_DeviceType: |
| 288 | // fall through |
| 289 | #if SK_ANGLE |
| 290 | case kAngle_DeviceType: |
rmistry@google.com | 6ab9673 | 2014-01-06 18:37:24 +0000 | [diff] [blame] | 291 | // fall through |
| 292 | #endif |
| 293 | #if SK_MESA |
| 294 | case kMesa_DeviceType: |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 295 | #endif |
| 296 | return true; |
| 297 | default: |
| 298 | return false; |
| 299 | } |
keyar@chromium.org | fe6391a | 2012-08-20 15:03:41 +0000 | [diff] [blame] | 300 | } |
keyar@chromium.org | 77a5522 | 2012-08-20 15:03:47 +0000 | [diff] [blame] | 301 | |
robertphillips@google.com | 6177e69 | 2013-02-28 20:16:25 +0000 | [diff] [blame] | 302 | SkGLContextHelper* getGLContext() { |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 303 | GrContextFactory::GLContextType glContextType |
| 304 | = GrContextFactory::kNull_GLContextType; |
| 305 | switch(fDeviceType) { |
| 306 | case kGPU_DeviceType: |
| 307 | glContextType = GrContextFactory::kNative_GLContextType; |
| 308 | break; |
| 309 | #if SK_ANGLE |
| 310 | case kAngle_DeviceType: |
| 311 | glContextType = GrContextFactory::kANGLE_GLContextType; |
| 312 | break; |
| 313 | #endif |
rmistry@google.com | 6ab9673 | 2014-01-06 18:37:24 +0000 | [diff] [blame] | 314 | #if SK_MESA |
| 315 | case kMesa_DeviceType: |
| 316 | glContextType = GrContextFactory::kMESA_GLContextType; |
| 317 | break; |
| 318 | #endif |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 319 | default: |
| 320 | return NULL; |
keyar@chromium.org | 77a5522 | 2012-08-20 15:03:47 +0000 | [diff] [blame] | 321 | } |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 322 | return fGrContextFactory.getGLContext(glContextType); |
keyar@chromium.org | 77a5522 | 2012-08-20 15:03:47 +0000 | [diff] [blame] | 323 | } |
robertphillips@google.com | 163c84b | 2012-09-13 15:40:37 +0000 | [diff] [blame] | 324 | |
| 325 | GrContext* getGrContext() { |
| 326 | return fGrContext; |
| 327 | } |
keyar@chromium.org | 4ea96c5 | 2012-08-20 15:03:29 +0000 | [diff] [blame] | 328 | #endif |
| 329 | |
keyar@chromium.org | 02dfb12 | 2012-08-20 15:03:36 +0000 | [diff] [blame] | 330 | PictureRenderer() |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 331 | : fPicture(NULL) |
commit-bot@chromium.org | a3f882c | 2013-12-13 20:52:36 +0000 | [diff] [blame] | 332 | , fJsonSummaryPtr(NULL) |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 333 | , fDeviceType(kBitmap_DeviceType) |
junov@chromium.org | 50ff9bd | 2012-11-02 19:16:22 +0000 | [diff] [blame] | 334 | , fBBoxHierarchyType(kNone_BBoxHierarchyType) |
scroggo@google.com | 06d6ac6 | 2013-02-08 21:16:19 +0000 | [diff] [blame] | 335 | , fScaleFactor(SK_Scalar1) |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 336 | #if SK_SUPPORT_GPU |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 337 | , fGrContext(NULL) |
jvanverth@google.com | f6a9033 | 2013-05-02 12:39:37 +0000 | [diff] [blame] | 338 | , fSampleCount(0) |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 339 | #endif |
caryclark@google.com | e3e940c | 2012-11-07 16:42:17 +0000 | [diff] [blame] | 340 | { |
robertphillips@google.com | 7ae918e | 2013-03-02 17:45:27 +0000 | [diff] [blame] | 341 | fGridInfo.fMargin.setEmpty(); |
| 342 | fGridInfo.fOffset.setZero(); |
| 343 | fGridInfo.fTileInterval.set(1, 1); |
caryclark@google.com | e3e940c | 2012-11-07 16:42:17 +0000 | [diff] [blame] | 344 | sk_bzero(fDrawFilters, sizeof(fDrawFilters)); |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 345 | fViewport.set(0, 0); |
caryclark@google.com | e3e940c | 2012-11-07 16:42:17 +0000 | [diff] [blame] | 346 | } |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 347 | |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 348 | #if SK_SUPPORT_GPU |
| 349 | virtual ~PictureRenderer() { |
| 350 | SkSafeUnref(fGrContext); |
| 351 | } |
| 352 | #endif |
| 353 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 354 | protected: |
| 355 | SkAutoTUnref<SkCanvas> fCanvas; |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 356 | SkPicture* fPicture; |
commit-bot@chromium.org | a3f882c | 2013-12-13 20:52:36 +0000 | [diff] [blame] | 357 | ImageResultsSummary* fJsonSummaryPtr; |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 358 | SkDeviceTypes fDeviceType; |
| 359 | BBoxHierarchyType fBBoxHierarchyType; |
| 360 | DrawFilterFlags fDrawFilters[SkDrawFilter::kTypeCount]; |
| 361 | SkString fDrawFiltersConfig; |
junov@chromium.org | 29b19e5 | 2013-02-27 18:35:16 +0000 | [diff] [blame] | 362 | SkTileGridPicture::TileGridInfo fGridInfo; // used when fBBoxHierarchyType is TileGrid |
keyar@chromium.org | 0612564 | 2012-08-20 15:03:33 +0000 | [diff] [blame] | 363 | |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 364 | void buildBBoxHierarchy(); |
| 365 | |
| 366 | /** |
| 367 | * Return the total width that should be drawn. If the viewport width has been set greater than |
| 368 | * 0, this will be the minimum of the current SkPicture's width and the viewport's width. |
| 369 | */ |
| 370 | int getViewWidth(); |
| 371 | |
| 372 | /** |
| 373 | * Return the total height that should be drawn. If the viewport height has been set greater |
| 374 | * than 0, this will be the minimum of the current SkPicture's height and the viewport's height. |
| 375 | */ |
| 376 | int getViewHeight(); |
| 377 | |
scroggo@google.com | 82ec0b0 | 2012-12-17 19:25:54 +0000 | [diff] [blame] | 378 | /** |
| 379 | * Scales the provided canvas to the scale factor set by setScaleFactor. |
| 380 | */ |
| 381 | void scaleToScaleFactor(SkCanvas*); |
| 382 | |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 383 | SkPicture* createPicture(); |
| 384 | uint32_t recordFlags(); |
| 385 | SkCanvas* setupCanvas(); |
| 386 | virtual SkCanvas* setupCanvas(int width, int height); |
| 387 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 388 | private: |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 389 | SkISize fViewport; |
scroggo@google.com | 82ec0b0 | 2012-12-17 19:25:54 +0000 | [diff] [blame] | 390 | SkScalar fScaleFactor; |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 391 | #if SK_SUPPORT_GPU |
| 392 | GrContextFactory fGrContextFactory; |
| 393 | GrContext* fGrContext; |
jvanverth@google.com | f6a9033 | 2013-05-02 12:39:37 +0000 | [diff] [blame] | 394 | int fSampleCount; |
scroggo@google.com | 0556ea0 | 2013-02-08 19:38:21 +0000 | [diff] [blame] | 395 | #endif |
scroggo@google.com | c0d5e54 | 2012-12-13 21:40:48 +0000 | [diff] [blame] | 396 | |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 397 | virtual SkString getConfigNameInternal() = 0; |
| 398 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 399 | typedef SkRefCnt INHERITED; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 400 | }; |
| 401 | |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 402 | /** |
| 403 | * This class does not do any rendering, but its render function executes recording, which we want |
| 404 | * to time. |
| 405 | */ |
| 406 | class RecordPictureRenderer : public PictureRenderer { |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 407 | virtual bool render(const SkString*, SkBitmap** out = NULL) SK_OVERRIDE; |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 408 | |
| 409 | virtual SkString getPerIterTimeFormat() SK_OVERRIDE { return SkString("%.4f"); } |
| 410 | |
| 411 | virtual SkString getNormalTimeFormat() SK_OVERRIDE { return SkString("%6.4f"); } |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 412 | |
djsollen@google.com | fd9720c | 2012-11-06 16:54:40 +0000 | [diff] [blame] | 413 | protected: |
| 414 | virtual SkCanvas* setupCanvas(int width, int height) SK_OVERRIDE; |
| 415 | |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 416 | private: |
| 417 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 418 | }; |
| 419 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 420 | class PipePictureRenderer : public PictureRenderer { |
keyar@chromium.org | 163b567 | 2012-08-01 17:53:29 +0000 | [diff] [blame] | 421 | public: |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 422 | virtual bool render(const SkString*, SkBitmap** out = NULL) SK_OVERRIDE; |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 423 | |
| 424 | private: |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 425 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 426 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 427 | typedef PictureRenderer INHERITED; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 428 | }; |
| 429 | |
| 430 | class SimplePictureRenderer : public PictureRenderer { |
keyar@chromium.org | 163b567 | 2012-08-01 17:53:29 +0000 | [diff] [blame] | 431 | public: |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 432 | virtual void init(SkPicture* pict) SK_OVERRIDE; |
| 433 | |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 434 | virtual bool render(const SkString*, SkBitmap** out = NULL) SK_OVERRIDE; |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 435 | |
| 436 | private: |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 437 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 438 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 439 | typedef PictureRenderer INHERITED; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 440 | }; |
| 441 | |
| 442 | class TiledPictureRenderer : public PictureRenderer { |
| 443 | public: |
| 444 | TiledPictureRenderer(); |
| 445 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 446 | virtual void init(SkPicture* pict) SK_OVERRIDE; |
scroggo@google.com | 81f9d2e | 2012-09-20 14:54:21 +0000 | [diff] [blame] | 447 | |
scroggo@google.com | 81f9d2e | 2012-09-20 14:54:21 +0000 | [diff] [blame] | 448 | /** |
| 449 | * Renders to tiles, rather than a single canvas. If a path is provided, a separate file is |
| 450 | * created for each tile, named "path0.png", "path1.png", etc. |
| 451 | * Multithreaded mode currently does not support writing to a file. |
| 452 | */ |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 453 | virtual bool render(const SkString* path, SkBitmap** out = NULL) SK_OVERRIDE; |
scroggo@google.com | 81f9d2e | 2012-09-20 14:54:21 +0000 | [diff] [blame] | 454 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 455 | virtual void end() SK_OVERRIDE; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 456 | |
keyar@chromium.org | cc6e5ef | 2012-07-27 20:09:26 +0000 | [diff] [blame] | 457 | void setTileWidth(int width) { |
| 458 | fTileWidth = width; |
| 459 | } |
| 460 | |
| 461 | int getTileWidth() const { |
| 462 | return fTileWidth; |
| 463 | } |
| 464 | |
| 465 | void setTileHeight(int height) { |
| 466 | fTileHeight = height; |
| 467 | } |
| 468 | |
| 469 | int getTileHeight() const { |
| 470 | return fTileHeight; |
| 471 | } |
| 472 | |
| 473 | void setTileWidthPercentage(double percentage) { |
| 474 | fTileWidthPercentage = percentage; |
| 475 | } |
| 476 | |
keyar@chromium.org | 163b567 | 2012-08-01 17:53:29 +0000 | [diff] [blame] | 477 | double getTileWidthPercentage() const { |
keyar@chromium.org | cc6e5ef | 2012-07-27 20:09:26 +0000 | [diff] [blame] | 478 | return fTileWidthPercentage; |
| 479 | } |
| 480 | |
| 481 | void setTileHeightPercentage(double percentage) { |
| 482 | fTileHeightPercentage = percentage; |
| 483 | } |
| 484 | |
keyar@chromium.org | 163b567 | 2012-08-01 17:53:29 +0000 | [diff] [blame] | 485 | double getTileHeightPercentage() const { |
keyar@chromium.org | cc6e5ef | 2012-07-27 20:09:26 +0000 | [diff] [blame] | 486 | return fTileHeightPercentage; |
| 487 | } |
| 488 | |
keyar@chromium.org | f4959ab | 2012-08-23 20:53:25 +0000 | [diff] [blame] | 489 | void setTileMinPowerOf2Width(int width) { |
| 490 | SkASSERT(SkIsPow2(width) && width > 0); |
| 491 | if (!SkIsPow2(width) || width <= 0) { |
| 492 | return; |
| 493 | } |
| 494 | |
| 495 | fTileMinPowerOf2Width = width; |
| 496 | } |
| 497 | |
| 498 | int getTileMinPowerOf2Width() const { |
| 499 | return fTileMinPowerOf2Width; |
| 500 | } |
| 501 | |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 502 | virtual TiledPictureRenderer* getTiledRenderer() SK_OVERRIDE { return this; } |
| 503 | |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 504 | virtual bool supportsTimingIndividualTiles() { return true; } |
| 505 | |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 506 | /** |
| 507 | * Report the number of tiles in the x and y directions. Must not be called before init. |
| 508 | * @param x Output parameter identifying the number of tiles in the x direction. |
| 509 | * @param y Output parameter identifying the number of tiles in the y direction. |
| 510 | * @return True if the tiles have been set up, and x and y are meaningful. If false, x and y are |
| 511 | * unmodified. |
| 512 | */ |
| 513 | bool tileDimensions(int& x, int&y); |
| 514 | |
| 515 | /** |
| 516 | * Move to the next tile and return its indices. Must be called before calling drawCurrentTile |
| 517 | * for the first time. |
| 518 | * @param i Output parameter identifying the column of the next tile to be drawn on the next |
| 519 | * call to drawNextTile. |
| 520 | * @param j Output parameter identifying the row of the next tile to be drawn on the next call |
| 521 | * to drawNextTile. |
| 522 | * @param True if the tiles have been created and the next tile to be drawn by drawCurrentTile |
| 523 | * is within the range of tiles. If false, i and j are unmodified. |
| 524 | */ |
| 525 | bool nextTile(int& i, int& j); |
| 526 | |
| 527 | /** |
| 528 | * Render one tile. This will draw the same tile each time it is called until nextTile is |
| 529 | * called. The tile rendered will depend on how many calls have been made to nextTile. |
| 530 | * It is an error to call this without first calling nextTile, or if nextTile returns false. |
| 531 | */ |
| 532 | void drawCurrentTile(); |
| 533 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 534 | protected: |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 535 | SkTDArray<SkRect> fTileRects; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 536 | |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 537 | virtual SkCanvas* setupCanvas(int width, int height) SK_OVERRIDE; |
| 538 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 539 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 540 | private: |
scroggo@google.com | cbcef70 | 2012-12-13 22:09:28 +0000 | [diff] [blame] | 541 | int fTileWidth; |
| 542 | int fTileHeight; |
| 543 | double fTileWidthPercentage; |
| 544 | double fTileHeightPercentage; |
| 545 | int fTileMinPowerOf2Width; |
| 546 | |
| 547 | // These variables are only used for timing individual tiles. |
| 548 | // Next tile to draw in fTileRects. |
| 549 | int fCurrentTileOffset; |
| 550 | // Number of tiles in the x direction. |
| 551 | int fTilesX; |
| 552 | // Number of tiles in the y direction. |
| 553 | int fTilesY; |
scroggo@google.com | bcdf2ec | 2012-09-20 14:42:33 +0000 | [diff] [blame] | 554 | |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 555 | void setupTiles(); |
keyar@chromium.org | f4959ab | 2012-08-23 20:53:25 +0000 | [diff] [blame] | 556 | void setupPowerOf2Tiles(); |
keyar@chromium.org | 9d696c0 | 2012-08-07 17:11:33 +0000 | [diff] [blame] | 557 | |
| 558 | typedef PictureRenderer INHERITED; |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 559 | }; |
| 560 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 561 | class CloneData; |
| 562 | |
| 563 | class MultiCorePictureRenderer : public TiledPictureRenderer { |
| 564 | public: |
| 565 | explicit MultiCorePictureRenderer(int threadCount); |
| 566 | |
| 567 | ~MultiCorePictureRenderer(); |
| 568 | |
| 569 | virtual void init(SkPicture* pict) SK_OVERRIDE; |
| 570 | |
| 571 | /** |
| 572 | * Behaves like TiledPictureRenderer::render(), only using multiple threads. |
| 573 | */ |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 574 | virtual bool render(const SkString* path, SkBitmap** out = NULL) SK_OVERRIDE; |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 575 | |
| 576 | virtual void end() SK_OVERRIDE; |
| 577 | |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 578 | virtual bool supportsTimingIndividualTiles() SK_OVERRIDE { return false; } |
| 579 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 580 | private: |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 581 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 582 | |
scroggo@google.com | a62da2f | 2012-11-02 21:28:12 +0000 | [diff] [blame] | 583 | const int fNumThreads; |
| 584 | SkTDArray<SkCanvas*> fCanvasPool; |
| 585 | SkThreadPool fThreadPool; |
| 586 | SkPicture* fPictureClones; |
| 587 | CloneData** fCloneData; |
| 588 | SkCountdown fCountdown; |
| 589 | |
| 590 | typedef TiledPictureRenderer INHERITED; |
| 591 | }; |
| 592 | |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 593 | /** |
| 594 | * This class does not do any rendering, but its render function executes turning an SkPictureRecord |
| 595 | * into an SkPicturePlayback, which we want to time. |
| 596 | */ |
| 597 | class PlaybackCreationRenderer : public PictureRenderer { |
| 598 | public: |
| 599 | virtual void setup() SK_OVERRIDE; |
| 600 | |
edisonn@google.com | 84f548c | 2012-12-18 22:24:03 +0000 | [diff] [blame] | 601 | virtual bool render(const SkString*, SkBitmap** out = NULL) SK_OVERRIDE; |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 602 | |
| 603 | virtual SkString getPerIterTimeFormat() SK_OVERRIDE { return SkString("%.4f"); } |
| 604 | |
| 605 | virtual SkString getNormalTimeFormat() SK_OVERRIDE { return SkString("%6.4f"); } |
| 606 | |
| 607 | private: |
junov@chromium.org | 9313ca4 | 2012-11-02 18:11:49 +0000 | [diff] [blame] | 608 | SkAutoTUnref<SkPicture> fReplayer; |
scroggo@google.com | 0a049b8 | 2012-11-02 22:01:26 +0000 | [diff] [blame] | 609 | |
| 610 | virtual SkString getConfigNameInternal() SK_OVERRIDE; |
| 611 | |
scroggo@google.com | 9a41252 | 2012-09-07 15:21:18 +0000 | [diff] [blame] | 612 | typedef PictureRenderer INHERITED; |
| 613 | }; |
| 614 | |
reed@google.com | fe7b1ed | 2012-11-29 21:00:39 +0000 | [diff] [blame] | 615 | extern PictureRenderer* CreateGatherPixelRefsRenderer(); |
reed@google.com | 5a34fd3 | 2012-12-10 16:05:09 +0000 | [diff] [blame] | 616 | extern PictureRenderer* CreatePictureCloneRenderer(); |
reed@google.com | fe7b1ed | 2012-11-29 21:00:39 +0000 | [diff] [blame] | 617 | |
keyar@chromium.org | 451bb9f | 2012-07-26 17:27:57 +0000 | [diff] [blame] | 618 | } |
| 619 | |
| 620 | #endif // PictureRenderer_DEFINED |