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

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

Issue 179163004: Have Document::topDocument() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 5316 matching lines...) Expand 10 before | Expand all | Expand 10 after
5327 5327
5328 LocalFrame* frame = canvas()->document().frame(); 5328 LocalFrame* frame = canvas()->document().frame();
5329 if (!frame) 5329 if (!frame)
5330 return; 5330 return;
5331 5331
5332 Settings* settings = frame->settings(); 5332 Settings* settings = frame->settings();
5333 5333
5334 if (!frame->loader().client()->allowWebGL(settings && settings->webGLEnabled ())) 5334 if (!frame->loader().client()->allowWebGL(settings && settings->webGLEnabled ()))
5335 return; 5335 return;
5336 5336
5337 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument()->url().string(), settings); 5337 blink::WebGraphicsContext3D::Attributes attributes = m_requestedAttributes-> attributes(canvas()->document().topDocument().url().string(), settings);
5338 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes)); 5338 OwnPtr<blink::WebGraphicsContext3D> context = adoptPtr(blink::Platform::curr ent()->createOffscreenGraphicsContext3D(attributes));
5339 if (!context) { 5339 if (!context) {
5340 if (m_contextLostMode == RealLostContext) { 5340 if (m_contextLostMode == RealLostContext) {
5341 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts); 5341 m_restoreTimer.startOneShot(secondsBetweenRestoreAttempts);
5342 } else { 5342 } else {
5343 // This likely shouldn't happen but is the best way to report it to the WebGL app. 5343 // This likely shouldn't happen but is the best way to report it to the WebGL app.
5344 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context "); 5344 synthesizeGLError(GL_INVALID_OPERATION, "", "error restoring context ");
5345 } 5345 }
5346 return; 5346 return;
5347 } 5347 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
5555 if (m_textureUnits[i].m_texture2DBinding 5555 if (m_textureUnits[i].m_texture2DBinding
5556 || m_textureUnits[i].m_textureCubeMapBinding) { 5556 || m_textureUnits[i].m_textureCubeMapBinding) {
5557 m_onePlusMaxNonDefaultTextureUnit = i + 1; 5557 m_onePlusMaxNonDefaultTextureUnit = i + 1;
5558 return; 5558 return;
5559 } 5559 }
5560 } 5560 }
5561 m_onePlusMaxNonDefaultTextureUnit = 0; 5561 m_onePlusMaxNonDefaultTextureUnit = 0;
5562 } 5562 }
5563 5563
5564 } // namespace WebCore 5564 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698