| 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/browser_plugin/browser_plugin_backing_store.h" | 5 #include "content/renderer/browser_plugin/browser_plugin_backing_store.h" |
| 6 | 6 |
| 7 #include "ui/gfx/canvas.h" | 7 #include "ui/gfx/canvas.h" |
| 8 #include "ui/gfx/rect.h" | 8 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/rect_conversions.h" | 9 #include "ui/gfx/rect_conversions.h" |
| 10 #include "ui/gfx/size_conversions.h" | 10 #include "ui/gfx/size_conversions.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 int pixel_dy = dy * scale_factor_; | 85 int pixel_dy = dy * scale_factor_; |
| 86 | 86 |
| 87 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx); | 87 int x = std::min(pixel_rect.x(), pixel_rect.x() - pixel_dx); |
| 88 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy); | 88 int y = std::min(pixel_rect.y(), pixel_rect.y() - pixel_dy); |
| 89 int w = pixel_rect.width() + abs(pixel_dx); | 89 int w = pixel_rect.width() + abs(pixel_dx); |
| 90 int h = pixel_rect.height() + abs(pixel_dy); | 90 int h = pixel_rect.height() + abs(pixel_dy); |
| 91 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h); | 91 SkIRect rect = SkIRect::MakeXYWH(x, y, w, h); |
| 92 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy); | 92 bitmap_.scrollRect(&rect, pixel_dx, pixel_dy); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void BrowserPluginBackingStore::Clear(SkColor clear_color) { |
| 96 canvas_->clear(clear_color); |
| 97 } |
| 98 |
| 95 } // namespace content | 99 } // namespace content |
| OLD | NEW |