OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" | 5 #include "webkit/gpu/webgraphicscontext3d_in_process_impl.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, bound_fbo_); | 639 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, bound_fbo_); |
640 | 640 |
641 #ifdef FLIP_FRAMEBUFFER_VERTICALLY | 641 #ifdef FLIP_FRAMEBUFFER_VERTICALLY |
642 if (pixels) | 642 if (pixels) |
643 FlipVertically(pixels, width, height); | 643 FlipVertically(pixels, width, height); |
644 #endif | 644 #endif |
645 | 645 |
646 return true; | 646 return true; |
647 } | 647 } |
648 | 648 |
| 649 #if 1 |
649 bool WebGraphicsContext3DInProcessImpl::readBackFramebuffer( | 650 bool WebGraphicsContext3DInProcessImpl::readBackFramebuffer( |
650 unsigned char* pixels, size_t bufferSize) { | 651 unsigned char* pixels, size_t bufferSize, bool bindDefaultFramebuffer) { |
651 return readBackFramebuffer(pixels, bufferSize, fbo_, width(), height()); | 652 if (bindDefaultFramebuffer) |
| 653 return readBackFramebuffer(pixels, bufferSize, fbo_, width(), height()); |
| 654 |
| 655 return readBackFramebuffer(pixels, bufferSize, bound_fbo_, width(), height()); |
652 } | 656 } |
| 657 #endif |
653 | 658 |
654 void WebGraphicsContext3DInProcessImpl::synthesizeGLError(WGC3Denum error) { | 659 void WebGraphicsContext3DInProcessImpl::synthesizeGLError(WGC3Denum error) { |
655 if (synthetic_errors_set_.find(error) == synthetic_errors_set_.end()) { | 660 if (synthetic_errors_set_.find(error) == synthetic_errors_set_.end()) { |
656 synthetic_errors_set_.insert(error); | 661 synthetic_errors_set_.insert(error); |
657 synthetic_errors_list_.push_back(error); | 662 synthetic_errors_list_.push_back(error); |
658 } | 663 } |
659 } | 664 } |
660 | 665 |
661 void* WebGraphicsContext3DInProcessImpl::mapBufferSubDataCHROMIUM( | 666 void* WebGraphicsContext3DInProcessImpl::mapBufferSubDataCHROMIUM( |
662 WGC3Denum target, WGC3Dintptr offset, | 667 WGC3Denum target, WGC3Dintptr offset, |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1628 if (length > 1) { | 1633 if (length > 1) { |
1629 entry->translated_source.reset(new char[length]); | 1634 entry->translated_source.reset(new char[length]); |
1630 ShGetObjectCode(compiler, entry->translated_source.get()); | 1635 ShGetObjectCode(compiler, entry->translated_source.get()); |
1631 } | 1636 } |
1632 entry->is_valid = true; | 1637 entry->is_valid = true; |
1633 return true; | 1638 return true; |
1634 } | 1639 } |
1635 | 1640 |
1636 } // namespace gpu | 1641 } // namespace gpu |
1637 } // namespace webkit | 1642 } // namespace webkit |
OLD | NEW |