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 "content/renderer/pepper/pepper_graphics_2d_host.h" | 5 #include "content/renderer/pepper/pepper_graphics_2d_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 texture_mailbox_modified_ = true; | 316 texture_mailbox_modified_ = true; |
317 | 317 |
318 bound_instance_ = new_instance; | 318 bound_instance_ = new_instance; |
319 return true; | 319 return true; |
320 } | 320 } |
321 | 321 |
322 // The |backing_bitmap| must be clipped to the |plugin_rect| to avoid painting | 322 // The |backing_bitmap| must be clipped to the |plugin_rect| to avoid painting |
323 // outside the plugin area. This can happen if the plugin has been resized since | 323 // outside the plugin area. This can happen if the plugin has been resized since |
324 // PaintImageData verified the image is within the plugin size. | 324 // PaintImageData verified the image is within the plugin size. |
325 void PepperGraphics2DHost::Paint(WebKit::WebCanvas* canvas, | 325 void PepperGraphics2DHost::Paint(blink::WebCanvas* canvas, |
326 const gfx::Rect& plugin_rect, | 326 const gfx::Rect& plugin_rect, |
327 const gfx::Rect& paint_rect) { | 327 const gfx::Rect& paint_rect) { |
328 TRACE_EVENT0("pepper", "PepperGraphics2DHost::Paint"); | 328 TRACE_EVENT0("pepper", "PepperGraphics2DHost::Paint"); |
329 ImageDataAutoMapper auto_mapper(image_data_.get()); | 329 ImageDataAutoMapper auto_mapper(image_data_.get()); |
330 const SkBitmap& backing_bitmap = *image_data_->GetMappedBitmap(); | 330 const SkBitmap& backing_bitmap = *image_data_->GetMappedBitmap(); |
331 | 331 |
332 gfx::Rect invalidate_rect = plugin_rect; | 332 gfx::Rect invalidate_rect = plugin_rect; |
333 invalidate_rect.Intersect(paint_rect); | 333 invalidate_rect.Intersect(paint_rect); |
334 SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect); | 334 SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect); |
335 SkAutoCanvasRestore auto_restore(canvas, true); | 335 SkAutoCanvasRestore auto_restore(canvas, true); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 gfx::Point inverse_scaled_point = | 790 gfx::Point inverse_scaled_point = |
791 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); | 791 gfx::ToFlooredPoint(gfx::ScalePoint(*delta, inverse_scale)); |
792 if (original_delta != inverse_scaled_point) | 792 if (original_delta != inverse_scaled_point) |
793 return false; | 793 return false; |
794 } | 794 } |
795 | 795 |
796 return true; | 796 return true; |
797 } | 797 } |
798 | 798 |
799 } // namespace content | 799 } // namespace content |
OLD | NEW |