Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Side by Side Diff: webkit/plugins/sad_plugin.cc

Issue 7019013: Removal of dependencies on PlatformDevice classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Syncing merge conflicts. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sad_plugin.h" 5 #include "webkit/plugins/sad_plugin.h"
6 6
7 #include "third_party/skia/include/core/SkPaint.h" 7 #include "third_party/skia/include/core/SkPaint.h"
8 #include "third_party/skia/include/core/SkScalar.h" 8 #include "third_party/skia/include/core/SkScalar.h"
9 #include "ui/gfx/blit.h" 9 #include "ui/gfx/blit.h"
10 #include "ui/gfx/canvas_skia.h" 10 #include "ui/gfx/canvas_skia.h"
(...skipping 20 matching lines...) Expand all
31 canvas.drawRectCoords(0, 0, SkIntToScalar(width), SkIntToScalar(height), 31 canvas.drawRectCoords(0, 0, SkIntToScalar(width), SkIntToScalar(height),
32 paint); 32 paint);
33 canvas.DrawBitmapInt(sad_plugin_bitmap, 33 canvas.DrawBitmapInt(sad_plugin_bitmap,
34 std::max(0, (width - sad_plugin_bitmap.width()) / 2), 34 std::max(0, (width - sad_plugin_bitmap.width()) / 2),
35 std::max(0, (height - sad_plugin_bitmap.height()) / 2)); 35 std::max(0, (height - sad_plugin_bitmap.height()) / 2));
36 36
37 // It's slightly less code to make a big SkBitmap of the sad tab image and 37 // It's slightly less code to make a big SkBitmap of the sad tab image and
38 // then copy that to the screen than to use the native APIs. The small speed 38 // then copy that to the screen than to use the native APIs. The small speed
39 // penalty is not important when drawing crashed plugins. 39 // penalty is not important when drawing crashed plugins.
40 #if WEBKIT_USING_SKIA 40 #if WEBKIT_USING_SKIA
41 gfx::NativeDrawingContext context = skia::BeginPlatformPaint(webcanvas); 41 skia::ScopedPlatformPaint scoped_platform_paint(webcanvas);
42 gfx::NativeDrawingContext context =
43 scoped_platform_paint.GetPlatformSurface();
42 BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0)); 44 BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0));
43 skia::EndPlatformPaint(webcanvas);
44 #elif WEBKIT_USING_CG 45 #elif WEBKIT_USING_CG
45 BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0)); 46 BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0));
46 #endif 47 #endif
47 } 48 }
48 49
49 } // namespace webkit 50 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_scrollbar_impl.cc ('k') | webkit/tools/test_shell/mac/webwidget_host.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698