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

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

Issue 6783023: Eliminate skia::PlatformCanvas - Step 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 = webcanvas->beginPlatformPaint(); 41 gfx::NativeDrawingContext context = skia::BeginPlatformPaint(webcanvas);
42 BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0)); 42 BlitCanvasToContext(context, plugin_rect, &canvas, gfx::Point(0, 0));
43 webcanvas->endPlatformPaint(); 43 skia::EndPlatformPaint(webcanvas);
44 #elif WEBKIT_USING_CG 44 #elif WEBKIT_USING_CG
45 BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0)); 45 BlitCanvasToContext(webcanvas, plugin_rect, &canvas, gfx::Point(0, 0));
46 #endif 46 #endif
47 } 47 }
48 48
49 } // namespace webkit 49 } // namespace webkit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698