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

Side by Side Diff: Source/WebCore/html/canvas/WebGLRenderingContext.cpp

Issue 11366017: Merge 132980 - Set the initial scissor box for WebGL (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month 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 | « no previous file | 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 createFallbackBlackTextures1x1(); 525 createFallbackBlackTextures1x1();
526 if (!isGLES2Compliant()) 526 if (!isGLES2Compliant())
527 initVertexAttrib0(); 527 initVertexAttrib0();
528 528
529 IntSize canvasSize = clampedCanvasSize(); 529 IntSize canvasSize = clampedCanvasSize();
530 if (m_drawingBuffer) 530 if (m_drawingBuffer)
531 m_drawingBuffer->reset(canvasSize); 531 m_drawingBuffer->reset(canvasSize);
532 532
533 m_context->reshape(canvasSize.width(), canvasSize.height()); 533 m_context->reshape(canvasSize.width(), canvasSize.height());
534 m_context->viewport(0, 0, canvasSize.width(), canvasSize.height()); 534 m_context->viewport(0, 0, canvasSize.width(), canvasSize.height());
535 m_context->scissor(0, 0, canvasSize.width(), canvasSize.height());
535 536
536 m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCall back(this))); 537 m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCall back(this)));
537 m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMe ssageCallback(this))); 538 m_context->setErrorMessageCallback(adoptPtr(new WebGLRenderingContextErrorMe ssageCallback(this)));
538 } 539 }
539 540
540 void WebGLRenderingContext::setupFlags() 541 void WebGLRenderingContext::setupFlags()
541 { 542 {
542 ASSERT(m_context); 543 ASSERT(m_context);
543 544
544 Page* p = canvas()->document()->page(); 545 Page* p = canvas()->document()->page();
(...skipping 5190 matching lines...) Expand 10 before | Expand all | Expand 10 after
5735 5736
5736 IntSize WebGLRenderingContext::clampedCanvasSize() 5737 IntSize WebGLRenderingContext::clampedCanvasSize()
5737 { 5738 {
5738 return IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]), 5739 return IntSize(clamp(canvas()->width(), 1, m_maxViewportDims[0]),
5739 clamp(canvas()->height(), 1, m_maxViewportDims[1])); 5740 clamp(canvas()->height(), 1, m_maxViewportDims[1]));
5740 } 5741 }
5741 5742
5742 } // namespace WebCore 5743 } // namespace WebCore
5743 5744
5744 #endif // ENABLE(WEBGL) 5745 #endif // ENABLE(WEBGL)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698