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 "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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // Valid when type == REPLACE. | 161 // Valid when type == REPLACE. |
162 scoped_refptr<PPB_ImageData_Impl> replace_image; | 162 scoped_refptr<PPB_ImageData_Impl> replace_image; |
163 }; | 163 }; |
164 | 164 |
165 PPB_Graphics2D_Impl::PPB_Graphics2D_Impl(PP_Instance instance) | 165 PPB_Graphics2D_Impl::PPB_Graphics2D_Impl(PP_Instance instance) |
166 : Resource(::ppapi::OBJECT_IS_IMPL, instance), | 166 : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
167 bound_instance_(NULL), | 167 bound_instance_(NULL), |
168 offscreen_flush_pending_(false), | 168 offscreen_flush_pending_(false), |
169 is_always_opaque_(false), | 169 is_always_opaque_(false), |
170 scale_(1.0f), | 170 scale_(1.0f), |
171 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 171 weak_ptr_factory_(this) { |
172 } | 172 } |
173 | 173 |
174 PPB_Graphics2D_Impl::~PPB_Graphics2D_Impl() { | 174 PPB_Graphics2D_Impl::~PPB_Graphics2D_Impl() { |
175 // LastPluginRefWasDeleted should have aborted all pending callbacks. | 175 // LastPluginRefWasDeleted should have aborted all pending callbacks. |
176 DCHECK(painted_flush_callback_.is_null()); | 176 DCHECK(painted_flush_callback_.is_null()); |
177 DCHECK(unpainted_flush_callback_.is_null()); | 177 DCHECK(unpainted_flush_callback_.is_null()); |
178 } | 178 } |
179 | 179 |
180 // static | 180 // static |
181 PP_Resource PPB_Graphics2D_Impl::Create(PP_Instance instance, | 181 PP_Resource PPB_Graphics2D_Impl::Create(PP_Instance instance, |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 } | 707 } |
708 | 708 |
709 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 709 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
710 return !unpainted_flush_callback_.is_null() || | 710 return !unpainted_flush_callback_.is_null() || |
711 !painted_flush_callback_.is_null() || | 711 !painted_flush_callback_.is_null() || |
712 offscreen_flush_pending_; | 712 offscreen_flush_pending_; |
713 } | 713 } |
714 | 714 |
715 } // namespace ppapi | 715 } // namespace ppapi |
716 } // namespace webkit | 716 } // namespace webkit |
OLD | NEW |