Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: third_party/WebKit/public/platform/Platform.h

Issue 1844363003: Move WebGraphicsContext3D::Attributes to Platform::ContextAttributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rm-alphadepthetc
Patch Set: move-attributes: webstring Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 virtual void removeTraceLogEnabledStateObserver(TraceLogEnabledStateObserver *) {} 453 virtual void removeTraceLogEnabledStateObserver(TraceLogEnabledStateObserver *) {}
454 454
455 typedef uint64_t WebMemoryAllocatorDumpGuid; 455 typedef uint64_t WebMemoryAllocatorDumpGuid;
456 456
457 // Returns guid corresponding to the given string (the hash value) for 457 // Returns guid corresponding to the given string (the hash value) for
458 // creating a WebMemoryAllocatorDump. 458 // creating a WebMemoryAllocatorDump.
459 virtual WebMemoryAllocatorDumpGuid createWebMemoryAllocatorDumpGuid(const We bString& guidStr) { return 0; } 459 virtual WebMemoryAllocatorDumpGuid createWebMemoryAllocatorDumpGuid(const We bString& guidStr) { return 0; }
460 460
461 // GPU ---------------------------------------------------------------- 461 // GPU ----------------------------------------------------------------
462 // 462 //
463 struct ContextAttributes {
464 bool shareResources = true;
465 bool preferDiscreteGPU = false;
466 bool noAutomaticFlushes = false;
467 bool failIfMajorPerformanceCaveat = false;
468 unsigned webGLVersion = 0;
469 };
463 struct GraphicsInfo { 470 struct GraphicsInfo {
464 unsigned vendorId = 0; 471 unsigned vendorId = 0;
465 unsigned deviceId = 0; 472 unsigned deviceId = 0;
466 unsigned processCrashCount = 0; 473 unsigned processCrashCount = 0;
467 unsigned resetNotificationStrategy = 0; 474 unsigned resetNotificationStrategy = 0;
468 bool sandboxed = false; 475 bool sandboxed = false;
469 bool testFailContext = false; 476 bool testFailContext = false;
470 bool amdSwitchable = false; 477 bool amdSwitchable = false;
471 bool optimus = false; 478 bool optimus = false;
472 WebString vendorInfo; 479 WebString vendorInfo;
473 WebString rendererInfo; 480 WebString rendererInfo;
474 WebString driverVersion; 481 WebString driverVersion;
475 WebString errorMessage; 482 WebString errorMessage;
476 }; 483 };
477 // Returns a newly allocated and initialized offscreen context provider, 484 // Returns a newly allocated and initialized offscreen context provider,
478 // backed by an independent context. Returns null if the context cannot be 485 // backed by an independent context. Returns null if the context cannot be
479 // created or initialized. 486 // created or initialized.
480 // Passing an existing provider to shareContext will create the new context 487 // Passing an existing provider to shareContext will create the new context
481 // in the same share group as the one passed. 488 // in the same share group as the one passed.
482 virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvid er(const WebGraphicsContext3D::Attributes&, WebGraphicsContext3DProvider* shareC ontext, GraphicsInfo* glInfo) { return nullptr; } 489 virtual WebGraphicsContext3DProvider* createOffscreenGraphicsContext3DProvid er(
490 const ContextAttributes&,
491 const WebURL& topDocumentURL,
492 WebGraphicsContext3DProvider* shareContext,
493 GraphicsInfo*) { return nullptr; }
483 494
484 // Returns a newly allocated and initialized offscreen context provider, 495 // Returns a newly allocated and initialized offscreen context provider,
485 // backed by the process-wide shared main thread context. Returns null if 496 // backed by the process-wide shared main thread context. Returns null if
486 // the context cannot be created or initialized. 497 // the context cannot be created or initialized.
487 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D Provider() { return nullptr; } 498 virtual WebGraphicsContext3DProvider* createSharedOffscreenGraphicsContext3D Provider() { return nullptr; }
488 499
489 // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas. 500 // Returns true if the platform is capable of producing an offscreen context suitable for accelerating 2d canvas.
490 // This will return false if the platform cannot promise that contexts will be preserved across operations like 501 // This will return false if the platform cannot promise that contexts will be preserved across operations like
491 // locking the screen or if the platform cannot provide a context with suita ble performance characteristics. 502 // locking the screen or if the platform cannot provide a context with suita ble performance characteristics.
492 // 503 //
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 protected: 649 protected:
639 Platform(); 650 Platform();
640 virtual ~Platform() { } 651 virtual ~Platform() { }
641 652
642 WebThread* m_mainThread; 653 WebThread* m_mainThread;
643 }; 654 };
644 655
645 } // namespace blink 656 } // namespace blink
646 657
647 #endif 658 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698