OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/proxy/ppb_image_data_proxy.h" | 5 #include "ppapi/proxy/ppb_image_data_proxy.h" |
6 | 6 |
7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 memset(data, 0, desc_.stride * desc_.size.height); | 424 memset(data, 0, desc_.stride * desc_.size.height); |
425 Unmap(); | 425 Unmap(); |
426 } | 426 } |
427 } | 427 } |
428 | 428 |
429 #if !defined(OS_NACL) | 429 #if !defined(OS_NACL) |
430 // static | 430 // static |
431 ImageHandle ImageData::NullHandle() { | 431 ImageHandle ImageData::NullHandle() { |
432 #if defined(OS_WIN) | 432 #if defined(OS_WIN) |
433 return NULL; | 433 return NULL; |
434 #elif defined(OS_MACOSX) || defined(OS_ANDROID) | 434 #elif defined(TOOLKIT_GTK) |
| 435 return 0; |
| 436 #else |
435 return ImageHandle(); | 437 return ImageHandle(); |
436 #else | |
437 return 0; | |
438 #endif | 438 #endif |
439 } | 439 } |
440 | 440 |
441 ImageHandle ImageData::HandleFromInt(int32_t i) { | 441 ImageHandle ImageData::HandleFromInt(int32_t i) { |
442 #if defined(OS_WIN) | 442 #if defined(OS_WIN) |
443 return reinterpret_cast<ImageHandle>(i); | 443 return reinterpret_cast<ImageHandle>(i); |
444 #elif defined(OS_MACOSX) || defined(OS_ANDROID) | 444 #elif defined(TOOLKIT_GTK) |
| 445 return static_cast<ImageHandle>(i); |
| 446 #else |
445 return ImageHandle(i, false); | 447 return ImageHandle(i, false); |
446 #else | |
447 return static_cast<ImageHandle>(i); | |
448 #endif | 448 #endif |
449 } | 449 } |
450 #endif // !defined(OS_NACL) | 450 #endif // !defined(OS_NACL) |
451 | 451 |
452 // PPB_ImageData_Proxy --------------------------------------------------------- | 452 // PPB_ImageData_Proxy --------------------------------------------------------- |
453 | 453 |
454 PPB_ImageData_Proxy::PPB_ImageData_Proxy(Dispatcher* dispatcher) | 454 PPB_ImageData_Proxy::PPB_ImageData_Proxy(Dispatcher* dispatcher) |
455 : InterfaceProxy(dispatcher) { | 455 : InterfaceProxy(dispatcher) { |
456 } | 456 } |
457 | 457 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 // still cached in our process, the proxy still holds a reference so we can | 630 // still cached in our process, the proxy still holds a reference so we can |
631 // remove the one the renderer just sent is. If the proxy no longer holds a | 631 // remove the one the renderer just sent is. If the proxy no longer holds a |
632 // reference, we released everything and we should also release the one the | 632 // reference, we released everything and we should also release the one the |
633 // renderer just sent us. | 633 // renderer just sent us. |
634 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( | 634 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( |
635 API_ID_PPB_CORE, old_image_data)); | 635 API_ID_PPB_CORE, old_image_data)); |
636 } | 636 } |
637 | 637 |
638 } // namespace proxy | 638 } // namespace proxy |
639 } // namespace ppapi | 639 } // namespace ppapi |
OLD | NEW |