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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" | 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" |
8 | 8 |
9 #include <GLES2/gl2.h> | 9 #include <GLES2/gl2.h> |
10 #ifndef GL_GLEXT_PROTOTYPES | 10 #ifndef GL_GLEXT_PROTOTYPES |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 if (onscreen) { | 581 if (onscreen) { |
582 if (render_surface == gfx::kNullPluginWindow) { | 582 if (render_surface == gfx::kNullPluginWindow) { |
583 LOG(ERROR) << "Invalid surface handle for onscreen context."; | 583 LOG(ERROR) << "Invalid surface handle for onscreen context."; |
584 command_buffer_.reset(); | 584 command_buffer_.reset(); |
585 } else { | 585 } else { |
586 if (!gpu_scheduler_->Initialize(render_surface, | 586 if (!gpu_scheduler_->Initialize(render_surface, |
587 gfx::Size(), | 587 gfx::Size(), |
588 ::gpu::gles2::DisallowedExtensions(), | 588 ::gpu::gles2::DisallowedExtensions(), |
589 allowed_extensions, | 589 allowed_extensions, |
590 attribs, | 590 attribs, |
591 NULL, | |
592 0, | |
593 share_group.get())) { | 591 share_group.get())) { |
594 LOG(ERROR) << "Could not initialize GpuScheduler."; | 592 LOG(ERROR) << "Could not initialize GpuScheduler."; |
595 command_buffer_.reset(); | 593 command_buffer_.reset(); |
596 } | 594 } |
597 } | 595 } |
598 } else { | 596 } else { |
599 GpuScheduler* parent_scheduler = | |
600 parent_.get() ? parent_->gpu_scheduler_ : NULL; | |
601 | |
602 if (!gpu_scheduler_->Initialize(render_surface, | 597 if (!gpu_scheduler_->Initialize(render_surface, |
603 size, | 598 size, |
604 ::gpu::gles2::DisallowedExtensions(), | 599 ::gpu::gles2::DisallowedExtensions(), |
605 allowed_extensions, | 600 allowed_extensions, |
606 attribs, | 601 attribs, |
607 parent_scheduler, | |
608 parent_texture_id_, | |
609 share_group.get())) { | 602 share_group.get())) { |
610 LOG(ERROR) << "Could not initialize offscreen GpuScheduler."; | 603 LOG(ERROR) << "Could not initialize offscreen GpuScheduler."; |
611 command_buffer_.reset(); | 604 command_buffer_.reset(); |
612 } | 605 } |
613 } | 606 } |
614 if (!command_buffer_.get()) { | 607 if (!command_buffer_.get()) { |
615 Destroy(); | 608 Destroy(); |
616 return false; | 609 return false; |
617 } | 610 } |
618 | 611 |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1792 if (context_lost_callback_) { | 1785 if (context_lost_callback_) { |
1793 context_lost_callback_->onContextLost(); | 1786 context_lost_callback_->onContextLost(); |
1794 } | 1787 } |
1795 } | 1788 } |
1796 | 1789 |
1797 } // namespace gpu | 1790 } // namespace gpu |
1798 } // namespace webkit | 1791 } // namespace webkit |
1799 | 1792 |
1800 #endif // defined(ENABLE_GPU) | 1793 #endif // defined(ENABLE_GPU) |
1801 | 1794 |
OLD | NEW |