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/logging.h" | 10 #include "base/logging.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 // Valid when type == SCROLL. | 148 // Valid when type == SCROLL. |
149 gfx::Rect scroll_clip_rect; | 149 gfx::Rect scroll_clip_rect; |
150 int scroll_dx, scroll_dy; | 150 int scroll_dx, scroll_dy; |
151 | 151 |
152 // Valid when type == REPLACE. | 152 // Valid when type == REPLACE. |
153 scoped_refptr<PPB_ImageData_Impl> replace_image; | 153 scoped_refptr<PPB_ImageData_Impl> replace_image; |
154 }; | 154 }; |
155 | 155 |
156 PPB_Graphics2D_Impl::PPB_Graphics2D_Impl(PP_Instance instance) | 156 PPB_Graphics2D_Impl::PPB_Graphics2D_Impl(PP_Instance instance) |
157 : Resource(instance), | 157 : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
158 bound_instance_(NULL), | 158 bound_instance_(NULL), |
159 offscreen_flush_pending_(false), | 159 offscreen_flush_pending_(false), |
160 is_always_opaque_(false), | 160 is_always_opaque_(false), |
161 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 161 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
162 } | 162 } |
163 | 163 |
164 PPB_Graphics2D_Impl::~PPB_Graphics2D_Impl() { | 164 PPB_Graphics2D_Impl::~PPB_Graphics2D_Impl() { |
165 // LastPluginRefWasDeleted should have aborted all pending callbacks. | 165 // LastPluginRefWasDeleted should have aborted all pending callbacks. |
166 DCHECK(painted_flush_callback_.is_null()); | 166 DCHECK(painted_flush_callback_.is_null()); |
167 DCHECK(unpainted_flush_callback_.is_null()); | 167 DCHECK(unpainted_flush_callback_.is_null()); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } | 670 } |
671 | 671 |
672 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 672 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
673 return !unpainted_flush_callback_.is_null() || | 673 return !unpainted_flush_callback_.is_null() || |
674 !painted_flush_callback_.is_null() || | 674 !painted_flush_callback_.is_null() || |
675 offscreen_flush_pending_; | 675 offscreen_flush_pending_; |
676 } | 676 } |
677 | 677 |
678 } // namespace ppapi | 678 } // namespace ppapi |
679 } // namespace webkit | 679 } // namespace webkit |
OLD | NEW |