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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 SkPaint paint; | 700 SkPaint paint; |
701 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 701 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
702 backing_canvas->drawBitmapRect(*image->GetMappedBitmap(), | 702 backing_canvas->drawBitmapRect(*image->GetMappedBitmap(), |
703 &src_irect, dest_rect, &paint); | 703 &src_irect, dest_rect, &paint); |
704 } | 704 } |
705 } | 705 } |
706 | 706 |
707 void PPB_Graphics2D_Impl::ExecuteScroll(const gfx::Rect& clip, | 707 void PPB_Graphics2D_Impl::ExecuteScroll(const gfx::Rect& clip, |
708 int dx, int dy, | 708 int dx, int dy, |
709 gfx::Rect* invalidated_rect) { | 709 gfx::Rect* invalidated_rect) { |
710 gfx::ScrollCanvas(image_data_->GetCanvas(), | 710 gfx::ScrollCanvas(image_data_->GetCanvas(), clip, gfx::Vector2d(dx, dy)); |
711 clip, gfx::Point(dx, dy)); | |
712 *invalidated_rect = clip; | 711 *invalidated_rect = clip; |
713 } | 712 } |
714 | 713 |
715 void PPB_Graphics2D_Impl::ExecuteReplaceContents(PPB_ImageData_Impl* image, | 714 void PPB_Graphics2D_Impl::ExecuteReplaceContents(PPB_ImageData_Impl* image, |
716 gfx::Rect* invalidated_rect, | 715 gfx::Rect* invalidated_rect, |
717 PP_Resource* old_image_data) { | 716 PP_Resource* old_image_data) { |
718 if (image->format() != image_data_->format()) { | 717 if (image->format() != image_data_->format()) { |
719 DCHECK(image->width() == image_data_->width() && | 718 DCHECK(image->width() == image_data_->width() && |
720 image->height() == image_data_->height()); | 719 image->height() == image_data_->height()); |
721 // Convert the image data if the format does not match. | 720 // Convert the image data if the format does not match. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 } | 761 } |
763 | 762 |
764 bool PPB_Graphics2D_Impl::HasPendingFlush() const { | 763 bool PPB_Graphics2D_Impl::HasPendingFlush() const { |
765 return !unpainted_flush_callback_.is_null() || | 764 return !unpainted_flush_callback_.is_null() || |
766 !painted_flush_callback_.is_null() || | 765 !painted_flush_callback_.is_null() || |
767 offscreen_flush_pending_; | 766 offscreen_flush_pending_; |
768 } | 767 } |
769 | 768 |
770 } // namespace ppapi | 769 } // namespace ppapi |
771 } // namespace webkit | 770 } // namespace webkit |
OLD | NEW |