OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 return result; | 103 return result; |
104 } | 104 } |
105 | 105 |
106 PP_Resource CreateGraphics3d() { | 106 PP_Resource CreateGraphics3d() { |
107 ProxyAutoLock lock; | 107 ProxyAutoLock lock; |
108 | 108 |
109 HostResource host_resource; | 109 HostResource host_resource; |
110 host_resource.SetHostResource(pp_instance(), kGraphics3D); | 110 host_resource.SetHostResource(pp_instance(), kGraphics3D); |
111 scoped_refptr<ppapi::proxy::Graphics3D> graphics_3d( | 111 scoped_refptr<ppapi::proxy::Graphics3D> graphics_3d( |
112 new ppapi::proxy::Graphics3D(host_resource)); | 112 new ppapi::proxy::Graphics3D(host_resource, gfx::Size(640, 480))); |
113 return graphics_3d->GetReference(); | 113 return graphics_3d->GetReference(); |
114 } | 114 } |
115 | 115 |
116 PP_Resource CreateAndInitializeDecoder() { | 116 PP_Resource CreateAndInitializeDecoder() { |
117 PP_Resource decoder = CreateDecoder(); | 117 PP_Resource decoder = CreateDecoder(); |
118 LockingResourceReleaser graphics3d(CreateGraphics3d()); | 118 LockingResourceReleaser graphics3d(CreateGraphics3d()); |
119 MockCompletionCallback cb; | 119 MockCompletionCallback cb; |
120 int32_t result = decoder_iface()->Initialize( | 120 int32_t result = decoder_iface()->Initialize( |
121 decoder, | 121 decoder, |
122 graphics3d.get(), | 122 graphics3d.get(), |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 ASSERT_FALSE(uncalled_cb.called()); | 582 ASSERT_FALSE(uncalled_cb.called()); |
583 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallFlush(decoder.get(), &uncalled_cb)); | 583 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallFlush(decoder.get(), &uncalled_cb)); |
584 ASSERT_FALSE(uncalled_cb.called()); | 584 ASSERT_FALSE(uncalled_cb.called()); |
585 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallReset(decoder.get(), &uncalled_cb)); | 585 ASSERT_EQ(PP_ERROR_RESOURCE_FAILED, CallReset(decoder.get(), &uncalled_cb)); |
586 ASSERT_FALSE(uncalled_cb.called()); | 586 ASSERT_FALSE(uncalled_cb.called()); |
587 } | 587 } |
588 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS) | 588 #endif // !defined(OS_WIN) || !defined(ARCH_CPU_64_BITS) |
589 | 589 |
590 } // namespace proxy | 590 } // namespace proxy |
591 } // namespace ppapi | 591 } // namespace ppapi |
OLD | NEW |