OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "content/renderer/ggl.h" | 5 #include "content/renderer/ggl.h" |
6 | 6 |
7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/weak_ptr.h" | 9 #include "base/weak_ptr.h" |
10 #include "chrome/renderer/command_buffer_proxy.h" | 10 #include "chrome/renderer/command_buffer_proxy.h" |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 if (!context) | 553 if (!context) |
554 return false; | 554 return false; |
555 | 555 |
556 delete context; | 556 delete context; |
557 return true; | 557 return true; |
558 #else | 558 #else |
559 return false; | 559 return false; |
560 #endif | 560 #endif |
561 } | 561 } |
562 | 562 |
| 563 base::WeakPtr<Context> GetWeakContextReference(Context* context) { |
| 564 #if defined(ENABLE_GPU) |
| 565 return context ? context->AsWeakPtr() : base::WeakPtr<Context>(); |
| 566 #else |
| 567 return base::WeakPtr<Context>(); |
| 568 #endif |
| 569 } |
| 570 |
563 media::VideoDecodeEngine* CreateVideoDecodeEngine(Context* context) { | 571 media::VideoDecodeEngine* CreateVideoDecodeEngine(Context* context) { |
564 return context->CreateVideoDecodeEngine(); | 572 return context->CreateVideoDecodeEngine(); |
565 } | 573 } |
566 | 574 |
567 media::VideoDecodeContext* CreateVideoDecodeContext( | 575 media::VideoDecodeContext* CreateVideoDecodeContext( |
568 Context* context, MessageLoop* message_loop, bool hardware_decoder) { | 576 Context* context, MessageLoop* message_loop, bool hardware_decoder) { |
569 return context->CreateVideoDecodeContext(message_loop, hardware_decoder); | 577 return context->CreateVideoDecodeContext(message_loop, hardware_decoder); |
570 } | 578 } |
571 | 579 |
572 Error GetError(Context* context) { | 580 Error GetError(Context* context) { |
(...skipping 23 matching lines...) Expand all Loading... |
596 | 604 |
597 return context->gles2_implementation(); | 605 return context->gles2_implementation(); |
598 } | 606 } |
599 | 607 |
600 CommandBufferProxy* GetCommandBufferProxy(Context* context) { | 608 CommandBufferProxy* GetCommandBufferProxy(Context* context) { |
601 DCHECK(context); | 609 DCHECK(context); |
602 return context->command_buffer(); | 610 return context->command_buffer(); |
603 } | 611 } |
604 | 612 |
605 } // namespace ggl | 613 } // namespace ggl |
OLD | NEW |