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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.cpp

Issue 826363002: Webgl Info should have vendorid and deviceid of gpu. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed unittest issue. Created 5 years, 9 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
« no previous file with comments | « LayoutTests/fast/canvas/webgl/webgl-error-response.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 return nullptr; 566 return nullptr;
567 } 567 }
568 568
569 blink::WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsConte xt3DAttributes(attributes, document.topDocument().url().string(), settings, webG LVersion); 569 blink::WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsConte xt3DAttributes(attributes, document.topDocument().url().string(), settings, webG LVersion);
570 blink::WebGLInfo glInfo; 570 blink::WebGLInfo glInfo;
571 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo)); 571 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo));
572 if (!context || shouldFailContextCreationForTesting) { 572 if (!context || shouldFailContextCreationForTesting) {
573 shouldFailContextCreationForTesting = false; 573 shouldFailContextCreationForTesting = false;
574 String statusMessage; 574 String statusMessage;
575 if (!glInfo.contextInfoCollectionFailure.isEmpty()) { 575 if (!glInfo.contextInfoCollectionFailure.isEmpty()) {
576 statusMessage.append("Could not create a WebGL context."); 576 statusMessage.append("Could not create a WebGL context. ");
577 statusMessage.append(glInfo.contextInfoCollectionFailure); 577 statusMessage.append(glInfo.contextInfoCollectionFailure);
578 String vendorId = String::number(glInfo.vendorId);
579 String deviceId = String::number(glInfo.deviceId);
580 if (vendorId.isEmpty())
581 statusMessage.append("VendorId = Not Available");
582 else
583 statusMessage.append("VendorId = " + vendorId);
584 if (deviceId.isEmpty())
585 statusMessage.append(", DeviceId = Not Available");
586 else
587 statusMessage.append(", DeviceId = " + deviceId);
578 } else { 588 } else {
579 statusMessage.append("Could not create a WebGL context"); 589 statusMessage.append("Could not create a WebGL context");
580 if (!glInfo.vendorInfo.isEmpty()) { 590 if (!glInfo.vendorInfo.isEmpty()) {
581 statusMessage.append(" VendorInfo = "); 591 statusMessage.append(", VendorInfo = ");
582 statusMessage.append(glInfo.vendorInfo); 592 statusMessage.append(glInfo.vendorInfo);
583 } else { 593 } else {
584 statusMessage.append(" VendorInfo = Not Available"); 594 statusMessage.append(", VendorInfo = Not Available");
585 } 595 }
586 if (!glInfo.rendererInfo.isEmpty()) { 596 if (!glInfo.rendererInfo.isEmpty()) {
587 statusMessage.append(", RendererInfo = "); 597 statusMessage.append(", RendererInfo = ");
588 statusMessage.append(glInfo.rendererInfo); 598 statusMessage.append(glInfo.rendererInfo);
589 } else { 599 } else {
590 statusMessage.append(", RendererInfo = Not Available"); 600 statusMessage.append(", RendererInfo = Not Available");
591 } 601 }
592 if (!glInfo.driverVersion.isEmpty()) { 602 if (!glInfo.driverVersion.isEmpty()) {
593 statusMessage.append(", DriverInfo = "); 603 statusMessage.append(", DriverInfo = ");
594 statusMessage.append(glInfo.driverVersion); 604 statusMessage.append(glInfo.driverVersion);
(...skipping 5420 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0; 6025 return m_sharedWebGraphicsContext3D ? m_sharedWebGraphicsContext3D->drawingB uffer() : 0;
6016 } 6026 }
6017 #else 6027 #else
6018 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6028 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6019 { 6029 {
6020 return m_drawingBuffer.get(); 6030 return m_drawingBuffer.get();
6021 } 6031 }
6022 #endif 6032 #endif
6023 6033
6024 } // namespace blink 6034 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/webgl/webgl-error-response.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698