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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 1384233003: Improve usefulness of webglcontextcreationerror statusMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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) 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 545
546 WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsContext3DAtt ributes(attributes, document.topDocument().url().string(), settings, webGLVersio n); 546 WebGraphicsContext3D::Attributes wgc3dAttributes = toWebGraphicsContext3DAtt ributes(attributes, document.topDocument().url().string(), settings, webGLVersio n);
547 WebGLInfo glInfo; 547 WebGLInfo glInfo;
548 OwnPtr<WebGraphicsContext3D> context = adoptPtr(Platform::current()->createO ffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo)); 548 OwnPtr<WebGraphicsContext3D> context = adoptPtr(Platform::current()->createO ffscreenGraphicsContext3D(wgc3dAttributes, 0, &glInfo));
549 if (!context || shouldFailContextCreationForTesting) { 549 if (!context || shouldFailContextCreationForTesting) {
550 shouldFailContextCreationForTesting = false; 550 shouldFailContextCreationForTesting = false;
551 String statusMessage; 551 String statusMessage;
552 if (!glInfo.contextInfoCollectionFailure.isEmpty()) { 552 if (!glInfo.contextInfoCollectionFailure.isEmpty()) {
553 statusMessage.append("Could not create a WebGL context. "); 553 statusMessage.append("Could not create a WebGL context. ");
554 statusMessage.append(glInfo.contextInfoCollectionFailure); 554 statusMessage.append(glInfo.contextInfoCollectionFailure);
555 String vendorId = String::number(glInfo.vendorId); 555 if (glInfo.vendorId.isEmpty()) {
Ken Russell (switch to Gerrit) 2015/10/06 23:33:15 Could you please figure out some way to do the num
sivag 2015/10/12 14:36:59 When i tested on my linux machine, deviceid and ve
556 String deviceId = String::number(glInfo.deviceId);
557 if (vendorId.isEmpty())
558 statusMessage.append("VendorId = Not Available"); 556 statusMessage.append("VendorId = Not Available");
559 else 557 } else {
560 statusMessage.append("VendorId = " + vendorId); 558 statusMessage.append("VendorId = ");
561 if (deviceId.isEmpty()) 559 statusMessage.append(glInfo.vendorId);
560 }
561 if (glInfo.deviceId.isEmpty()) {
562 statusMessage.append(", DeviceId = Not Available"); 562 statusMessage.append(", DeviceId = Not Available");
563 else 563 } else {
564 statusMessage.append(", DeviceId = " + deviceId); 564 statusMessage.append(", DeviceId = ");
565 statusMessage.append(glInfo.deviceId);
566 }
565 } else { 567 } else {
566 statusMessage.append("Could not create a WebGL context"); 568 statusMessage.append("Could not create a WebGL context");
567 if (!glInfo.vendorInfo.isEmpty()) { 569 if (!glInfo.vendorInfo.isEmpty()) {
568 statusMessage.append(", VendorInfo = "); 570 statusMessage.append(", VendorInfo = ");
569 statusMessage.append(glInfo.vendorInfo); 571 statusMessage.append(glInfo.vendorInfo);
570 } else { 572 } else {
571 statusMessage.append(", VendorInfo = Not Available"); 573 statusMessage.append(", VendorInfo = Not Available");
572 } 574 }
573 if (!glInfo.rendererInfo.isEmpty()) { 575 if (!glInfo.rendererInfo.isEmpty()) {
574 statusMessage.append(", RendererInfo = "); 576 statusMessage.append(", RendererInfo = ");
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 RefPtr<DrawingBuffer> buffer = createDrawingBuffer(context); 899 RefPtr<DrawingBuffer> buffer = createDrawingBuffer(context);
898 if (!buffer) { 900 if (!buffer) {
899 m_contextLostMode = SyntheticLostContext; 901 m_contextLostMode = SyntheticLostContext;
900 return; 902 return;
901 } 903 }
902 904
903 m_drawingBuffer = buffer.release(); 905 m_drawingBuffer = buffer.release();
904 906
905 drawingBuffer()->bind(GL_FRAMEBUFFER); 907 drawingBuffer()->bind(GL_FRAMEBUFFER);
906 setupFlags(); 908 setupFlags();
907 909
908 #define ADD_VALUES_TO_SET(set, values) \ 910 #define ADD_VALUES_TO_SET(set, values) \
909 for (size_t i = 0; i < arraysize(values); ++i) { \ 911 for (size_t i = 0; i < arraysize(values); ++i) { \
910 set.insert(values[i]); \ 912 set.insert(values[i]); \
911 } 913 }
912 914
913 ADD_VALUES_TO_SET(m_supportedInternalFormats, kSupportedInternalFormatsES2); 915 ADD_VALUES_TO_SET(m_supportedInternalFormats, kSupportedInternalFormatsES2);
914 ADD_VALUES_TO_SET(m_supportedFormats, kSupportedFormatsES2); 916 ADD_VALUES_TO_SET(m_supportedFormats, kSupportedFormatsES2);
915 ADD_VALUES_TO_SET(m_supportedTypes, kSupportedTypesES2); 917 ADD_VALUES_TO_SET(m_supportedTypes, kSupportedTypesES2);
916 ADD_VALUES_TO_SET(m_supportedFormatTypeCombinations, kSupportedFormatTypesES 2); 918 ADD_VALUES_TO_SET(m_supportedFormatTypeCombinations, kSupportedFormatTypesES 2);
917 } 919 }
(...skipping 5813 matching lines...) Expand 10 before | Expand all | Expand 10 after
6731 6733
6732 return totalBytesPerPixel; 6734 return totalBytesPerPixel;
6733 } 6735 }
6734 6736
6735 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const 6737 DrawingBuffer* WebGLRenderingContextBase::drawingBuffer() const
6736 { 6738 {
6737 return m_drawingBuffer.get(); 6739 return m_drawingBuffer.get();
6738 } 6740 }
6739 6741
6740 } // namespace blink 6742 } // namespace blink
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.cc ('k') | third_party/WebKit/public/platform/WebGraphicsContext3D.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698