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

Unified Diff: ui/gfx/blit.cc

Issue 6677142: rename getBitmapDC to beginPlatformPaint and add calls to endPlatformPaint (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/vector_platform_device_emf_win.cc ('k') | ui/views/widget/native_widget_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/blit.cc
diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc
index 9f57e681a3a90927ad787116f36530b1f7fd980e..76411a3d85a7ef3b8945767f4c5a20053c8ae61a 100644
--- a/ui/gfx/blit.cc
+++ b/ui/gfx/blit.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -91,24 +91,13 @@ void BlitContextToContext(NativeDrawingContext dst_context,
#endif
}
-static NativeDrawingContext GetContextFromCanvas(
- skia::PlatformCanvas *canvas) {
- skia::PlatformDevice& device = canvas->getTopPlatformDevice();
-#if defined(OS_WIN)
- return device.getBitmapDC();
-#elif defined(OS_MACOSX)
- return device.GetBitmapContext();
-#else // Linux, BSD, others
- return device.beginPlatformPaint();
-#endif
-}
-
void BlitContextToCanvas(skia::PlatformCanvas *dst_canvas,
const Rect& dst_rect,
NativeDrawingContext src_context,
const Point& src_origin) {
- BlitContextToContext(GetContextFromCanvas(dst_canvas), dst_rect,
+ BlitContextToContext(dst_canvas->beginPlatformPaint(), dst_rect,
src_context, src_origin);
+ dst_canvas->endPlatformPaint();
}
void BlitCanvasToContext(NativeDrawingContext dst_context,
@@ -116,15 +105,18 @@ void BlitCanvasToContext(NativeDrawingContext dst_context,
skia::PlatformCanvas *src_canvas,
const Point& src_origin) {
BlitContextToContext(dst_context, dst_rect,
- GetContextFromCanvas(src_canvas), src_origin);
+ src_canvas->beginPlatformPaint(), src_origin);
+ src_canvas->endPlatformPaint();
}
void BlitCanvasToCanvas(skia::PlatformCanvas *dst_canvas,
const Rect& dst_rect,
skia::PlatformCanvas *src_canvas,
const Point& src_origin) {
- BlitContextToContext(GetContextFromCanvas(dst_canvas), dst_rect,
- GetContextFromCanvas(src_canvas), src_origin);
+ BlitContextToContext(dst_canvas->beginPlatformPaint(), dst_rect,
+ src_canvas->beginPlatformPaint(), src_origin);
+ src_canvas->endPlatformPaint();
+ dst_canvas->endPlatformPaint();
}
#if defined(OS_WIN)
« no previous file with comments | « skia/ext/vector_platform_device_emf_win.cc ('k') | ui/views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698