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* | 179 ::ppapi::thunk::PPB_Graphics2D_API* PPB_Graphics2D_Impl::AsGraphics2D_API() { |
180 PPB_Graphics2D_Impl::AsPPB_Graphics2D_API() { | |
181 return this; | 180 return this; |
182 } | 181 } |
183 | 182 |
184 PPB_Graphics2D_Impl* PPB_Graphics2D_Impl::AsPPB_Graphics2D_Impl() { | 183 PPB_Graphics2D_Impl* PPB_Graphics2D_Impl::AsPPB_Graphics2D_Impl() { |
185 return this; | 184 return this; |
186 } | 185 } |
187 | 186 |
188 PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, | 187 PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, |
189 PP_Bool* is_always_opaque) { | 188 PP_Bool* is_always_opaque) { |
190 size->width = image_data_->width(); | 189 size->width = image_data_->width(); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 } | 606 } |
608 | 607 |
609 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 608 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
610 return !unpainted_flush_callback_.is_null() || | 609 return !unpainted_flush_callback_.is_null() || |
611 !painted_flush_callback_.is_null() || | 610 !painted_flush_callback_.is_null() || |
612 offscreen_flush_pending_; | 611 offscreen_flush_pending_; |
613 } | 612 } |
614 | 613 |
615 } // namespace ppapi | 614 } // namespace ppapi |
616 } // namespace webkit | 615 } // namespace webkit |
OLD | NEW |