| 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 27 matching lines...) Expand all Loading... |
| 38 #include "GraphicsContext3D.h" | 38 #include "GraphicsContext3D.h" |
| 39 #include "ImageData.h" | 39 #include "ImageData.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 // Global resource ceiling (expressed in terms of pixels) for DrawingBuffer crea
tion and resize. | 43 // Global resource ceiling (expressed in terms of pixels) for DrawingBuffer crea
tion and resize. |
| 44 // When this limit is set, DrawingBuffer::create() and DrawingBuffer::reset() ca
lls that would | 44 // When this limit is set, DrawingBuffer::create() and DrawingBuffer::reset() ca
lls that would |
| 45 // exceed the global cap will instead clear the buffer. | 45 // exceed the global cap will instead clear the buffer. |
| 46 #if PLATFORM(CHROMIUM) // Currently, this cap only exists for chromium. | 46 #if PLATFORM(CHROMIUM) // Currently, this cap only exists for chromium. |
| 47 static int s_maximumResourceUsePixels = 16 * 1024 * 1024; | 47 static int s_maximumResourceUsePixels = 16 * 1024 * 1024; |
| 48 #elif !PLATFORM(BLACKBERRY) | 48 #else |
| 49 static int s_maximumResourceUsePixels = 0; | 49 static int s_maximumResourceUsePixels = 0; |
| 50 #endif | 50 #endif |
| 51 static int s_currentResourceUsePixels = 0; | 51 static int s_currentResourceUsePixels = 0; |
| 52 static const float s_resourceAdjustedRatio = 0.5; | 52 static const float s_resourceAdjustedRatio = 0.5; |
| 53 | 53 |
| 54 PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, cons
t IntSize& size, PreserveDrawingBuffer preserve, AlphaRequirement alpha) | 54 PassRefPtr<DrawingBuffer> DrawingBuffer::create(GraphicsContext3D* context, cons
t IntSize& size, PreserveDrawingBuffer preserve, AlphaRequirement alpha) |
| 55 { | 55 { |
| 56 Extensions3D* extensions = context->getExtensions(); | 56 Extensions3D* extensions = context->getExtensions(); |
| 57 bool multisampleSupported = extensions->maySupportMultisampling() | 57 bool multisampleSupported = extensions->maySupportMultisampling() |
| 58 && extensions->supports("GL_ANGLE_framebuffer_blit") | 58 && extensions->supports("GL_ANGLE_framebuffer_blit") |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 { | 424 { |
| 425 if (!m_context) | 425 if (!m_context) |
| 426 return; | 426 return; |
| 427 | 427 |
| 428 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); | 428 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_multisampleFBO
? m_multisampleFBO : m_fbo); |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace WebCore | 431 } // namespace WebCore |
| 432 | 432 |
| 433 #endif | 433 #endif |
| OLD | NEW |