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

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

Issue 1790753002: Expose GLES2Interface to blink, and delete isContextLost() from WGC3D. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 27 matching lines...) Expand all
38 #include "core/frame/Settings.h" 38 #include "core/frame/Settings.h"
39 #include "core/html/HTMLCanvasElement.h" 39 #include "core/html/HTMLCanvasElement.h"
40 #include "core/html/HTMLImageElement.h" 40 #include "core/html/HTMLImageElement.h"
41 #include "core/html/HTMLVideoElement.h" 41 #include "core/html/HTMLVideoElement.h"
42 #include "core/html/ImageData.h" 42 #include "core/html/ImageData.h"
43 #include "core/inspector/ConsoleMessage.h" 43 #include "core/inspector/ConsoleMessage.h"
44 #include "core/inspector/InspectorInstrumentation.h" 44 #include "core/inspector/InspectorInstrumentation.h"
45 #include "core/layout/LayoutBox.h" 45 #include "core/layout/LayoutBox.h"
46 #include "core/loader/FrameLoader.h" 46 #include "core/loader/FrameLoader.h"
47 #include "core/loader/FrameLoaderClient.h" 47 #include "core/loader/FrameLoaderClient.h"
48 #include "gpu/command_buffer/client/gles2_interface.h"
48 #include "modules/webgl/ANGLEInstancedArrays.h" 49 #include "modules/webgl/ANGLEInstancedArrays.h"
49 #include "modules/webgl/CHROMIUMSubscribeUniform.h" 50 #include "modules/webgl/CHROMIUMSubscribeUniform.h"
50 #include "modules/webgl/CHROMIUMValuebuffer.h" 51 #include "modules/webgl/CHROMIUMValuebuffer.h"
51 #include "modules/webgl/EXTBlendMinMax.h" 52 #include "modules/webgl/EXTBlendMinMax.h"
52 #include "modules/webgl/EXTFragDepth.h" 53 #include "modules/webgl/EXTFragDepth.h"
53 #include "modules/webgl/EXTShaderTextureLOD.h" 54 #include "modules/webgl/EXTShaderTextureLOD.h"
54 #include "modules/webgl/EXTTextureFilterAnisotropic.h" 55 #include "modules/webgl/EXTTextureFilterAnisotropic.h"
55 #include "modules/webgl/OESElementIndexUint.h" 56 #include "modules/webgl/OESElementIndexUint.h"
56 #include "modules/webgl/OESStandardDerivatives.h" 57 #include "modules/webgl/OESStandardDerivatives.h"
57 #include "modules/webgl/OESTextureFloat.h" 58 #include "modules/webgl/OESTextureFloat.h"
(...skipping 5007 matching lines...) Expand 10 before | Expand all | Expand 10 after
5065 void WebGLRenderingContextBase::setFilterQuality(SkFilterQuality filterQuality) 5066 void WebGLRenderingContextBase::setFilterQuality(SkFilterQuality filterQuality)
5066 { 5067 {
5067 if (!isContextLost() && drawingBuffer()) { 5068 if (!isContextLost() && drawingBuffer()) {
5068 drawingBuffer()->setFilterQuality(filterQuality); 5069 drawingBuffer()->setFilterQuality(filterQuality);
5069 } 5070 }
5070 } 5071 }
5071 5072
5072 Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil() 5073 Extensions3DUtil* WebGLRenderingContextBase::extensionsUtil()
5073 { 5074 {
5074 if (!m_extensionsUtil) { 5075 if (!m_extensionsUtil) {
5075 m_extensionsUtil = Extensions3DUtil::create(webContext()); 5076 WebGraphicsContext3D* context = webContext();
5077 gpu::gles2::GLES2Interface* gl = context->getGLES2Interface();
5078 m_extensionsUtil = Extensions3DUtil::create(context, gl);
5076 // The only reason the ExtensionsUtil should be invalid is if the webCon text is lost. 5079 // The only reason the ExtensionsUtil should be invalid is if the webCon text is lost.
5077 ASSERT(m_extensionsUtil->isValid() || webContext()->isContextLost()); 5080 ASSERT(m_extensionsUtil->isValid() || gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
5078 } 5081 }
5079 return m_extensionsUtil.get(); 5082 return m_extensionsUtil.get();
5080 } 5083 }
5081 5084
5082 void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object) 5085 void WebGLRenderingContextBase::removeSharedObject(WebGLSharedObject* object)
5083 { 5086 {
5084 m_contextGroup->removeObject(object); 5087 m_contextGroup->removeObject(object);
5085 } 5088 }
5086 5089
5087 void WebGLRenderingContextBase::addSharedObject(WebGLSharedObject* object) 5090 void WebGLRenderingContextBase::addSharedObject(WebGLSharedObject* object)
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
6285 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1); 6288 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, 1);
6286 } 6289 }
6287 6290
6288 void WebGLRenderingContextBase::restoreUnpackParameters() 6291 void WebGLRenderingContextBase::restoreUnpackParameters()
6289 { 6292 {
6290 if (m_unpackAlignment != 1) 6293 if (m_unpackAlignment != 1)
6291 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment); 6294 webContext()->pixelStorei(GL_UNPACK_ALIGNMENT, m_unpackAlignment);
6292 } 6295 }
6293 6296
6294 } // namespace blink 6297 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698