Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 #include "core/inspector/InspectorInstrumentation.h" | 68 #include "core/inspector/InspectorInstrumentation.h" |
| 69 #include "core/loader/FrameLoader.h" | 69 #include "core/loader/FrameLoader.h" |
| 70 #include "core/loader/FrameLoaderClient.h" | 70 #include "core/loader/FrameLoaderClient.h" |
| 71 #include "core/frame/Frame.h" | 71 #include "core/frame/Frame.h" |
| 72 #include "core/page/Settings.h" | 72 #include "core/page/Settings.h" |
| 73 #include "core/platform/graphics/Extensions3D.h" | 73 #include "core/platform/graphics/Extensions3D.h" |
| 74 #include "core/platform/graphics/gpu/DrawingBuffer.h" | 74 #include "core/platform/graphics/gpu/DrawingBuffer.h" |
| 75 #include "core/rendering/RenderBox.h" | 75 #include "core/rendering/RenderBox.h" |
| 76 #include "platform/NotImplemented.h" | 76 #include "platform/NotImplemented.h" |
| 77 #include "platform/geometry/IntSize.h" | 77 #include "platform/geometry/IntSize.h" |
| 78 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | |
| 78 | 79 |
| 79 #include "wtf/PassOwnPtr.h" | 80 #include "wtf/PassOwnPtr.h" |
| 80 #include "wtf/Uint32Array.h" | 81 #include "wtf/Uint32Array.h" |
| 81 #include "wtf/text/StringBuilder.h" | 82 #include "wtf/text/StringBuilder.h" |
| 82 | 83 |
| 83 namespace WebCore { | 84 namespace WebCore { |
| 84 | 85 |
| 85 const double secondsBetweenRestoreAttempts = 1.0; | 86 const double secondsBetweenRestoreAttempts = 1.0; |
| 86 const int maxGLErrorsAllowedToConsole = 256; | 87 const int maxGLErrorsAllowedToConsole = 256; |
| 87 const unsigned maxGLActiveContexts = 16; | 88 const unsigned maxGLActiveContexts = 16; |
| (...skipping 5363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5451 for (i = 0; i < m_capacity; ++i) { | 5452 for (i = 0; i < m_capacity; ++i) { |
| 5452 ImageBuffer* buf = m_buffers[i].get(); | 5453 ImageBuffer* buf = m_buffers[i].get(); |
| 5453 if (!buf) | 5454 if (!buf) |
| 5454 break; | 5455 break; |
| 5455 if (buf->logicalSize() != size) | 5456 if (buf->logicalSize() != size) |
| 5456 continue; | 5457 continue; |
| 5457 bubbleToFront(i); | 5458 bubbleToFront(i); |
| 5458 return buf; | 5459 return buf; |
| 5459 } | 5460 } |
| 5460 | 5461 |
| 5461 OwnPtr<ImageBuffer> temp = ImageBuffer::create(size, 1); | 5462 OwnPtr<ImageBufferSurface> surface = adoptPtr(new UnacceleratedImageBufferSu rface(size)); |
| 5462 if (!temp) | 5463 if (!surface->isValid()) |
|
Stephen White
2013/12/04 21:18:40
Do we need a null ptr check here?
| |
| 5463 return 0; | 5464 return 0; |
| 5465 OwnPtr<ImageBuffer> temp = adoptPtr(new ImageBuffer(surface.release())); | |
| 5464 i = std::min(m_capacity - 1, i); | 5466 i = std::min(m_capacity - 1, i); |
| 5465 m_buffers[i] = temp.release(); | 5467 m_buffers[i] = temp.release(); |
| 5466 | 5468 |
| 5467 ImageBuffer* buf = m_buffers[i].get(); | 5469 ImageBuffer* buf = m_buffers[i].get(); |
| 5468 bubbleToFront(i); | 5470 bubbleToFront(i); |
| 5469 return buf; | 5471 return buf; |
| 5470 } | 5472 } |
| 5471 | 5473 |
| 5472 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx) | 5474 void WebGLRenderingContext::LRUImageBufferCache::bubbleToFront(int idx) |
| 5473 { | 5475 { |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5619 if (m_textureUnits[i].m_texture2DBinding | 5621 if (m_textureUnits[i].m_texture2DBinding |
| 5620 || m_textureUnits[i].m_textureCubeMapBinding) { | 5622 || m_textureUnits[i].m_textureCubeMapBinding) { |
| 5621 m_onePlusMaxNonDefaultTextureUnit = i + 1; | 5623 m_onePlusMaxNonDefaultTextureUnit = i + 1; |
| 5622 return; | 5624 return; |
| 5623 } | 5625 } |
| 5624 } | 5626 } |
| 5625 m_onePlusMaxNonDefaultTextureUnit = 0; | 5627 m_onePlusMaxNonDefaultTextureUnit = 0; |
| 5626 } | 5628 } |
| 5627 | 5629 |
| 5628 } // namespace WebCore | 5630 } // namespace WebCore |
| OLD | NEW |