| 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 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_graphics_2d_impl.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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if (!image_data_->Init(PPB_ImageData_Impl::GetNativeImageDataFormat(), | 169 if (!image_data_->Init(PPB_ImageData_Impl::GetNativeImageDataFormat(), |
| 170 width, height, true) || | 170 width, height, true) || |
| 171 !image_data_->Map()) { | 171 !image_data_->Map()) { |
| 172 image_data_ = NULL; | 172 image_data_ = NULL; |
| 173 return false; | 173 return false; |
| 174 } | 174 } |
| 175 is_always_opaque_ = is_always_opaque; | 175 is_always_opaque_ = is_always_opaque; |
| 176 return true; | 176 return true; |
| 177 } | 177 } |
| 178 | 178 |
| 179 ::ppapi::thunk::PPB_Graphics2D_API* PPB_Graphics2D_Impl::AsGraphics2D_API() { | 179 ::ppapi::thunk::PPB_Graphics2D_API* |
| 180 PPB_Graphics2D_Impl::AsPPB_Graphics2D_API() { |
| 180 return this; | 181 return this; |
| 181 } | 182 } |
| 182 | 183 |
| 183 PPB_Graphics2D_Impl* PPB_Graphics2D_Impl::AsPPB_Graphics2D_Impl() { | 184 PPB_Graphics2D_Impl* PPB_Graphics2D_Impl::AsPPB_Graphics2D_Impl() { |
| 184 return this; | 185 return this; |
| 185 } | 186 } |
| 186 | 187 |
| 187 PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, | 188 PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, |
| 188 PP_Bool* is_always_opaque) { | 189 PP_Bool* is_always_opaque) { |
| 189 size->width = image_data_->width(); | 190 size->width = image_data_->width(); |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 } | 607 } |
| 607 | 608 |
| 608 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 609 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
| 609 return !unpainted_flush_callback_.is_null() || | 610 return !unpainted_flush_callback_.is_null() || |
| 610 !painted_flush_callback_.is_null() || | 611 !painted_flush_callback_.is_null() || |
| 611 offscreen_flush_pending_; | 612 offscreen_flush_pending_; |
| 612 } | 613 } |
| 613 | 614 |
| 614 } // namespace ppapi | 615 } // namespace ppapi |
| 615 } // namespace webkit | 616 } // namespace webkit |
| OLD | NEW |