| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef PictureRenderer_DEFINED | 8 #ifndef PictureRenderer_DEFINED |
| 9 #define PictureRenderer_DEFINED | 9 #define PictureRenderer_DEFINED |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 enum SkDeviceTypes { | 68 enum SkDeviceTypes { |
| 69 #if SK_ANGLE | 69 #if SK_ANGLE |
| 70 kAngle_DeviceType, | 70 kAngle_DeviceType, |
| 71 #endif | 71 #endif |
| 72 #if SK_MESA | 72 #if SK_MESA |
| 73 kMesa_DeviceType, | 73 kMesa_DeviceType, |
| 74 #endif | 74 #endif |
| 75 kBitmap_DeviceType, | 75 kBitmap_DeviceType, |
| 76 #if SK_SUPPORT_GPU | 76 #if SK_SUPPORT_GPU |
| 77 kGPU_DeviceType, | 77 kGPU_DeviceType, |
| 78 kNVPR_DeviceType, |
| 78 #endif | 79 #endif |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 enum BBoxHierarchyType { | 82 enum BBoxHierarchyType { |
| 82 kNone_BBoxHierarchyType = 0, | 83 kNone_BBoxHierarchyType = 0, |
| 83 kQuadTree_BBoxHierarchyType, | 84 kQuadTree_BBoxHierarchyType, |
| 84 kRTree_BBoxHierarchyType, | 85 kRTree_BBoxHierarchyType, |
| 85 kTileGrid_BBoxHierarchyType, | 86 kTileGrid_BBoxHierarchyType, |
| 86 }; | 87 }; |
| 87 | 88 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Set to Native so it will have an initial value. | 170 // Set to Native so it will have an initial value. |
| 170 GrContextFactory::GLContextType glContextType = GrContextFactory::kNativ
e_GLContextType; | 171 GrContextFactory::GLContextType glContextType = GrContextFactory::kNativ
e_GLContextType; |
| 171 #endif | 172 #endif |
| 172 switch(deviceType) { | 173 switch(deviceType) { |
| 173 case kBitmap_DeviceType: | 174 case kBitmap_DeviceType: |
| 174 return true; | 175 return true; |
| 175 #if SK_SUPPORT_GPU | 176 #if SK_SUPPORT_GPU |
| 176 case kGPU_DeviceType: | 177 case kGPU_DeviceType: |
| 177 // Already set to GrContextFactory::kNative_GLContextType, above
. | 178 // Already set to GrContextFactory::kNative_GLContextType, above
. |
| 178 break; | 179 break; |
| 180 case kNVPR_DeviceType: |
| 181 glContextType = GrContextFactory::kNVPR_GLContextType; |
| 182 break; |
| 179 #if SK_ANGLE | 183 #if SK_ANGLE |
| 180 case kAngle_DeviceType: | 184 case kAngle_DeviceType: |
| 181 glContextType = GrContextFactory::kANGLE_GLContextType; | 185 glContextType = GrContextFactory::kANGLE_GLContextType; |
| 182 break; | 186 break; |
| 183 #endif | 187 #endif |
| 184 #if SK_MESA | 188 #if SK_MESA |
| 185 case kMesa_DeviceType: | 189 case kMesa_DeviceType: |
| 186 glContextType = GrContextFactory::kMESA_GLContextType; | 190 glContextType = GrContextFactory::kMESA_GLContextType; |
| 187 break; | 191 break; |
| 188 #endif | 192 #endif |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 259 } |
| 256 #if SK_SUPPORT_GPU | 260 #if SK_SUPPORT_GPU |
| 257 switch (fDeviceType) { | 261 switch (fDeviceType) { |
| 258 case kGPU_DeviceType: | 262 case kGPU_DeviceType: |
| 259 if (fSampleCount) { | 263 if (fSampleCount) { |
| 260 config.appendf("_msaa%d", fSampleCount); | 264 config.appendf("_msaa%d", fSampleCount); |
| 261 } else { | 265 } else { |
| 262 config.append("_gpu"); | 266 config.append("_gpu"); |
| 263 } | 267 } |
| 264 break; | 268 break; |
| 269 case kNVPR_DeviceType: |
| 270 config.appendf("_nvprmsaa%d", fSampleCount); |
| 271 break; |
| 265 #if SK_ANGLE | 272 #if SK_ANGLE |
| 266 case kAngle_DeviceType: | 273 case kAngle_DeviceType: |
| 267 config.append("_angle"); | 274 config.append("_angle"); |
| 268 break; | 275 break; |
| 269 #endif | 276 #endif |
| 270 #if SK_MESA | 277 #if SK_MESA |
| 271 case kMesa_DeviceType: | 278 case kMesa_DeviceType: |
| 272 config.append("_mesa"); | 279 config.append("_mesa"); |
| 273 break; | 280 break; |
| 274 #endif | 281 #endif |
| 275 default: | 282 default: |
| 276 // Assume that no extra info means bitmap. | 283 // Assume that no extra info means bitmap. |
| 277 break; | 284 break; |
| 278 } | 285 } |
| 279 #endif | 286 #endif |
| 280 config.append(fDrawFiltersConfig.c_str()); | 287 config.append(fDrawFiltersConfig.c_str()); |
| 281 return config; | 288 return config; |
| 282 } | 289 } |
| 283 | 290 |
| 284 #if SK_SUPPORT_GPU | 291 #if SK_SUPPORT_GPU |
| 285 bool isUsingGpuDevice() { | 292 bool isUsingGpuDevice() { |
| 286 switch (fDeviceType) { | 293 switch (fDeviceType) { |
| 287 case kGPU_DeviceType: | 294 case kGPU_DeviceType: |
| 295 case kNVPR_DeviceType: |
| 288 // fall through | 296 // fall through |
| 289 #if SK_ANGLE | 297 #if SK_ANGLE |
| 290 case kAngle_DeviceType: | 298 case kAngle_DeviceType: |
| 291 // fall through | 299 // fall through |
| 292 #endif | 300 #endif |
| 293 #if SK_MESA | 301 #if SK_MESA |
| 294 case kMesa_DeviceType: | 302 case kMesa_DeviceType: |
| 295 #endif | 303 #endif |
| 296 return true; | 304 return true; |
| 297 default: | 305 default: |
| 298 return false; | 306 return false; |
| 299 } | 307 } |
| 300 } | 308 } |
| 301 | 309 |
| 302 SkGLContextHelper* getGLContext() { | 310 SkGLContextHelper* getGLContext() { |
| 303 GrContextFactory::GLContextType glContextType | 311 GrContextFactory::GLContextType glContextType |
| 304 = GrContextFactory::kNull_GLContextType; | 312 = GrContextFactory::kNull_GLContextType; |
| 305 switch(fDeviceType) { | 313 switch(fDeviceType) { |
| 306 case kGPU_DeviceType: | 314 case kGPU_DeviceType: |
| 307 glContextType = GrContextFactory::kNative_GLContextType; | 315 glContextType = GrContextFactory::kNative_GLContextType; |
| 308 break; | 316 break; |
| 317 case kNVPR_DeviceType: |
| 318 glContextType = GrContextFactory::kNVPR_GLContextType; |
| 319 break; |
| 309 #if SK_ANGLE | 320 #if SK_ANGLE |
| 310 case kAngle_DeviceType: | 321 case kAngle_DeviceType: |
| 311 glContextType = GrContextFactory::kANGLE_GLContextType; | 322 glContextType = GrContextFactory::kANGLE_GLContextType; |
| 312 break; | 323 break; |
| 313 #endif | 324 #endif |
| 314 #if SK_MESA | 325 #if SK_MESA |
| 315 case kMesa_DeviceType: | 326 case kMesa_DeviceType: |
| 316 glContextType = GrContextFactory::kMESA_GLContextType; | 327 glContextType = GrContextFactory::kMESA_GLContextType; |
| 317 break; | 328 break; |
| 318 #endif | 329 #endif |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 | 622 |
| 612 typedef PictureRenderer INHERITED; | 623 typedef PictureRenderer INHERITED; |
| 613 }; | 624 }; |
| 614 | 625 |
| 615 extern PictureRenderer* CreateGatherPixelRefsRenderer(); | 626 extern PictureRenderer* CreateGatherPixelRefsRenderer(); |
| 616 extern PictureRenderer* CreatePictureCloneRenderer(); | 627 extern PictureRenderer* CreatePictureCloneRenderer(); |
| 617 | 628 |
| 618 } | 629 } |
| 619 | 630 |
| 620 #endif // PictureRenderer_DEFINED | 631 #endif // PictureRenderer_DEFINED |
| OLD | NEW |