| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 adjustedSize.setHeight(maxTextureSize); | 732 adjustedSize.setHeight(maxTextureSize); |
| 733 | 733 |
| 734 if (adjustedSize.width() > maxTextureSize) | 734 if (adjustedSize.width() > maxTextureSize) |
| 735 adjustedSize.setWidth(maxTextureSize); | 735 adjustedSize.setWidth(maxTextureSize); |
| 736 | 736 |
| 737 return adjustedSize; | 737 return adjustedSize; |
| 738 } | 738 } |
| 739 | 739 |
| 740 bool DrawingBuffer::reset(const IntSize& newSize) | 740 bool DrawingBuffer::reset(const IntSize& newSize) |
| 741 { | 741 { |
| 742 ASSERT(!newSize.isEmpty()); | 742 CHECK(!newSize.isEmpty()); |
| 743 IntSize adjustedSize = adjustSize(newSize, m_size, m_maxTextureSize); | 743 IntSize adjustedSize = adjustSize(newSize, m_size, m_maxTextureSize); |
| 744 if (adjustedSize.isEmpty()) | 744 if (adjustedSize.isEmpty()) |
| 745 return false; | 745 return false; |
| 746 | 746 |
| 747 if (adjustedSize != m_size) { | 747 if (adjustedSize != m_size) { |
| 748 do { | 748 do { |
| 749 if (!resizeDefaultFramebuffer(adjustedSize)) { | 749 if (!resizeDefaultFramebuffer(adjustedSize)) { |
| 750 adjustedSize.scale(s_resourceAdjustedRatio); | 750 adjustedSize.scale(s_resourceAdjustedRatio); |
| 751 continue; | 751 continue; |
| 752 } | 752 } |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 | 1088 |
| 1089 void DrawingBuffer::restoreTextureBindings() | 1089 void DrawingBuffer::restoreTextureBindings() |
| 1090 { | 1090 { |
| 1091 // This class potentially modifies the bindings for GL_TEXTURE_2D and | 1091 // This class potentially modifies the bindings for GL_TEXTURE_2D and |
| 1092 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since | 1092 // GL_TEXTURE_RECTANGLE. Only GL_TEXTURE_2D needs to be restored since |
| 1093 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. | 1093 // the public interface for WebGL does not support GL_TEXTURE_RECTANGLE. |
| 1094 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); | 1094 m_gl->BindTexture(GL_TEXTURE_2D, m_texture2DBinding); |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 } // namespace blink | 1097 } // namespace blink |
| OLD | NEW |