| 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 "webkit/glue/plugins/pepper_device_context_2d.h" | 5 #include "webkit/glue/plugins/pepper_device_context_2d.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 rect->size.width, rect->size.height); | 61 rect->size.width, rect->size.height); |
| 62 } | 62 } |
| 63 return true; | 63 return true; |
| 64 } | 64 } |
| 65 | 65 |
| 66 PP_Resource Create(PP_Module module_id, | 66 PP_Resource Create(PP_Module module_id, |
| 67 const PP_Size* size, | 67 const PP_Size* size, |
| 68 bool is_always_opaque) { | 68 bool is_always_opaque) { |
| 69 PluginModule* module = PluginModule::FromPPModule(module_id); | 69 PluginModule* module = PluginModule::FromPPModule(module_id); |
| 70 if (!module) | 70 if (!module) |
| 71 return NULL; | 71 return 0; |
| 72 | 72 |
| 73 scoped_refptr<DeviceContext2D> context(new DeviceContext2D(module)); | 73 scoped_refptr<DeviceContext2D> context(new DeviceContext2D(module)); |
| 74 if (!context->Init(size->width, size->height, is_always_opaque)) | 74 if (!context->Init(size->width, size->height, is_always_opaque)) |
| 75 return NULL; | 75 return 0; |
| 76 return context->GetReference(); | 76 return context->GetReference(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 bool IsDeviceContext2D(PP_Resource resource) { | 79 bool IsDeviceContext2D(PP_Resource resource) { |
| 80 return !!Resource::GetAs<DeviceContext2D>(resource); | 80 return !!Resource::GetAs<DeviceContext2D>(resource); |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool Describe(PP_Resource device_context, | 83 bool Describe(PP_Resource device_context, |
| 84 PP_Size* size, | 84 PP_Size* size, |
| 85 bool* is_always_opaque) { | 85 bool* is_always_opaque) { |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 data.Execute(PP_OK); | 544 data.Execute(PP_OK); |
| 545 } | 545 } |
| 546 | 546 |
| 547 bool DeviceContext2D::HasPendingFlush() const { | 547 bool DeviceContext2D::HasPendingFlush() const { |
| 548 return !unpainted_flush_callback_.is_null() || | 548 return !unpainted_flush_callback_.is_null() || |
| 549 !painted_flush_callback_.is_null() || | 549 !painted_flush_callback_.is_null() || |
| 550 offscreen_flush_pending_; | 550 offscreen_flush_pending_; |
| 551 } | 551 } |
| 552 | 552 |
| 553 } // namespace pepper | 553 } // namespace pepper |
| OLD | NEW |