| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 virtual void removeTraceLogEnabledStateObserver(TraceLogEnabledStateObserver
*) {} | 450 virtual void removeTraceLogEnabledStateObserver(TraceLogEnabledStateObserver
*) {} |
| 451 | 451 |
| 452 typedef uint64_t WebMemoryAllocatorDumpGuid; | 452 typedef uint64_t WebMemoryAllocatorDumpGuid; |
| 453 | 453 |
| 454 // Returns guid corresponding to the given string (the hash value) for | 454 // Returns guid corresponding to the given string (the hash value) for |
| 455 // creating a WebMemoryAllocatorDump. | 455 // creating a WebMemoryAllocatorDump. |
| 456 virtual WebMemoryAllocatorDumpGuid createWebMemoryAllocatorDumpGuid(const We
bString& guidStr) { return 0; } | 456 virtual WebMemoryAllocatorDumpGuid createWebMemoryAllocatorDumpGuid(const We
bString& guidStr) { return 0; } |
| 457 | 457 |
| 458 // GPU ---------------------------------------------------------------- | 458 // GPU ---------------------------------------------------------------- |
| 459 // | 459 // |
| 460 struct ContextAttributes { |
| 461 bool shareResources = true; |
| 462 bool preferDiscreteGPU = false; |
| 463 bool noAutomaticFlushes = false; |
| 464 bool failIfMajorPerformanceCaveat = false; |
| 465 unsigned webGLVersion = 0; |
| 466 }; |
| 460 struct GraphicsInfo { | 467 struct GraphicsInfo { |
| 461 unsigned vendorId = 0; | 468 unsigned vendorId = 0; |
| 462 unsigned deviceId = 0; | 469 unsigned deviceId = 0; |
| 463 unsigned processCrashCount = 0; | 470 unsigned processCrashCount = 0; |
| 464 unsigned resetNotificationStrategy = 0; | 471 unsigned resetNotificationStrategy = 0; |
| 465 bool sandboxed = false; | 472 bool sandboxed = false; |
| 466 bool amdSwitchable = false; | 473 bool amdSwitchable = false; |
| 467 bool optimus = false; | 474 bool optimus = false; |
| 468 WebString vendorInfo; | 475 WebString vendorInfo; |
| 469 WebString rendererInfo; | 476 WebString rendererInfo; |
| 470 WebString driverVersion; | 477 WebString driverVersion; |
| 471 WebString errorMessage; | 478 WebString errorMessage; |
| 472 }; | 479 }; |
| 473 // Returns a newly allocated and initialized offscreen context provider, | 480 // Returns a newly allocated and initialized offscreen context provider, |
| 474 // backed by an independent context. Returns null if the context cannot be | 481 // backed by an independent context. Returns null if the context cannot be |
| 475 // created or initialized. | 482 // created or initialized. |
| 476 // Passing an existing provider to shareContext will create the new context | 483 // Passing an existing provider to shareContext will create the new context |
| 477 // in the same share group as the one passed. | 484 // in the same share group as the one passed. |
| 478 virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvid
er(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3DProvider* shareC
ontext, GraphicsInfo* glInfo) { return nullptr; } | 485 virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvid
er( |
| 486 const ContextAttributes&, |
| 487 const WebURL& topDocumentURL, |
| 488 WebGraphicsContext3DProvider* shareContext, |
| 489 GraphicsInfo*) { return nullptr; } |
| 479 | 490 |
| 480 // Returns a newly allocated and initialized offscreen context provider, | 491 // Returns a newly allocated and initialized offscreen context provider, |
| 481 // backed by the process-wide shared main thread context. Returns null if | 492 // backed by the process-wide shared main thread context. Returns null if |
| 482 // the context cannot be created or initialized. | 493 // the context cannot be created or initialized. |
| 483 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D
Provider() { return nullptr; } | 494 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D
Provider() { return nullptr; } |
| 484 | 495 |
| 485 // Returns true if the platform is capable of producing an offscreen context
suitable for accelerating 2d canvas. | 496 // Returns true if the platform is capable of producing an offscreen context
suitable for accelerating 2d canvas. |
| 486 // This will return false if the platform cannot promise that contexts will
be preserved across operations like | 497 // This will return false if the platform cannot promise that contexts will
be preserved across operations like |
| 487 // locking the screen or if the platform cannot provide a context with suita
ble performance characteristics. | 498 // locking the screen or if the platform cannot provide a context with suita
ble performance characteristics. |
| 488 // | 499 // |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 protected: | 636 protected: |
| 626 Platform(); | 637 Platform(); |
| 627 virtual ~Platform() { } | 638 virtual ~Platform() { } |
| 628 | 639 |
| 629 WebThread* m_mainThread; | 640 WebThread* m_mainThread; |
| 630 }; | 641 }; |
| 631 | 642 |
| 632 } // namespace blink | 643 } // namespace blink |
| 633 | 644 |
| 634 #endif | 645 #endif |
| OLD | NEW |