OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #define PEPPER_APIS_ENABLED 1 | 5 #define PEPPER_APIS_ENABLED 1 |
6 | 6 |
7 #include "chrome/renderer/webplugin_delegate_pepper.h" | 7 #include "chrome/renderer/webplugin_delegate_pepper.h" |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 if (nested_delegate_) { | 1433 if (nested_delegate_) { |
1434 // TODO(apatrick): The GPU plugin will render to an offscreen render target. | 1434 // TODO(apatrick): The GPU plugin will render to an offscreen render target. |
1435 // Need to copy it to the screen here. | 1435 // Need to copy it to the screen here. |
1436 } else { | 1436 } else { |
1437 // Blit from background_context to context. | 1437 // Blit from background_context to context. |
1438 if (!committed_bitmap_.isNull()) { | 1438 if (!committed_bitmap_.isNull()) { |
1439 #if defined(OS_MACOSX) | 1439 #if defined(OS_MACOSX) |
1440 DrawSkBitmapToCanvas(committed_bitmap_, canvas, window_rect_, | 1440 DrawSkBitmapToCanvas(committed_bitmap_, canvas, window_rect_, |
1441 static_cast<int>(CGBitmapContextGetHeight(canvas))); | 1441 static_cast<int>(CGBitmapContextGetHeight(canvas))); |
1442 #else | 1442 #else |
1443 gfx::Point origin(window_rect_.origin().x(), window_rect_.origin().y()); | |
1444 canvas->drawBitmap(committed_bitmap_, | 1443 canvas->drawBitmap(committed_bitmap_, |
1445 SkIntToScalar(window_rect_.origin().x()), | 1444 SkIntToScalar(window_rect_.origin().x()), |
1446 SkIntToScalar(window_rect_.origin().y())); | 1445 SkIntToScalar(window_rect_.origin().y())); |
1447 #endif | 1446 #endif |
1448 } | 1447 } |
1449 } | 1448 } |
1450 } | 1449 } |
1451 | 1450 |
1452 void WebPluginDelegatePepper::Print(gfx::NativeDrawingContext context) { | 1451 void WebPluginDelegatePepper::Print(gfx::NativeDrawingContext context) { |
1453 NOTIMPLEMENTED(); | 1452 NOTIMPLEMENTED(); |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1761 CGRect bounds; | 1760 CGRect bounds; |
1762 bounds.origin.x = dest_rect.x(); | 1761 bounds.origin.x = dest_rect.x(); |
1763 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height(); | 1762 bounds.origin.y = canvas_height - dest_rect.y() - dest_rect.height(); |
1764 bounds.size.width = dest_rect.width(); | 1763 bounds.size.width = dest_rect.width(); |
1765 bounds.size.height = dest_rect.height(); | 1764 bounds.size.height = dest_rect.height(); |
1766 | 1765 |
1767 CGContextDrawImage(canvas, bounds, image); | 1766 CGContextDrawImage(canvas, bounds, image); |
1768 CGContextRestoreGState(canvas); | 1767 CGContextRestoreGState(canvas); |
1769 } | 1768 } |
1770 #endif // defined(OS_MACOSX) | 1769 #endif // defined(OS_MACOSX) |
OLD | NEW |