| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 if (plugin_instance->IsFullPagePlugin()) { | 339 if (plugin_instance->IsFullPagePlugin()) { |
| 340 // When we're resizing a window with a full-frame plugin, the plugin may | 340 // When we're resizing a window with a full-frame plugin, the plugin may |
| 341 // not yet have bound a new device, which will leave parts of the | 341 // not yet have bound a new device, which will leave parts of the |
| 342 // background exposed if the window is getting larger. We want this to | 342 // background exposed if the window is getting larger. We want this to |
| 343 // show white (typically less jarring) rather than black or uninitialized. | 343 // show white (typically less jarring) rather than black or uninitialized. |
| 344 // We don't do this for non-full-frame plugins since we specifically want | 344 // We don't do this for non-full-frame plugins since we specifically want |
| 345 // the page background to show through. | 345 // the page background to show through. |
| 346 SkAutoCanvasRestore auto_restore(canvas, true); | 346 SkAutoCanvasRestore auto_restore(canvas, true); |
| 347 SkRect image_data_rect = | 347 SkRect image_data_rect = |
| 348 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size)); | 348 gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size)); |
| 349 canvas->clipRect(image_data_rect, kDifference_SkClipOp); | 349 canvas->clipRect(image_data_rect, SkClipOp::kDifference); |
| 350 | 350 |
| 351 SkPaint paint; | 351 SkPaint paint; |
| 352 paint.setBlendMode(SkBlendMode::kSrc); | 352 paint.setBlendMode(SkBlendMode::kSrc); |
| 353 paint.setColor(SK_ColorWHITE); | 353 paint.setColor(SK_ColorWHITE); |
| 354 canvas->drawRect(sk_invalidate_rect, paint); | 354 canvas->drawRect(sk_invalidate_rect, paint); |
| 355 } | 355 } |
| 356 | 356 |
| 357 SkPaint paint; | 357 SkPaint paint; |
| 358 if (is_always_opaque_) { | 358 if (is_always_opaque_) { |
| 359 // When we know the device is opaque, we can disable blending for slightly | 359 // When we know the device is opaque, we can disable blending for slightly |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 gfx::Point inverse_scaled_point = | 829 gfx::Point inverse_scaled_point = |
| 830 gfx::ScaleToFlooredPoint(*delta, inverse_scale); | 830 gfx::ScaleToFlooredPoint(*delta, inverse_scale); |
| 831 if (original_delta != inverse_scaled_point) | 831 if (original_delta != inverse_scaled_point) |
| 832 return false; | 832 return false; |
| 833 } | 833 } |
| 834 | 834 |
| 835 return true; | 835 return true; |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace content | 838 } // namespace content |
| OLD | NEW |