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

Unified Diff: skia/ext/bitmap_platform_device_win.cc

Issue 2612863002: Make skia::GetNativeDrawingContext Windows-only (Closed)
Patch Set: more guarding Created 3 years, 11 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/bitmap_platform_device_mac_unittest.cc ('k') | skia/ext/platform_canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_win.cc
diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc
index 8270be329cc820f64cec2840ea4e42263304d22c..d537ca06c20a0dc529359f2eaf119621d89f1f5e 100644
--- a/skia/ext/bitmap_platform_device_win.cc
+++ b/skia/ext/bitmap_platform_device_win.cc
@@ -48,6 +48,19 @@ void DrawToNativeContext(SkCanvas* canvas, HDC destination_hdc, int x, int y,
canvas->getTotalMatrix());
}
+HDC GetNativeDrawingContext(SkCanvas* canvas) {
+ PlatformDevice* platform_device = GetPlatformDevice(canvas->getTopDevice(true));
+ if (!platform_device)
+ return nullptr;
+
+ // Compensate for drawing to a layer rather than the entire canvas
+ SkMatrix ctm;
+ SkIRect clip_bounds;
+ canvas->temporary_internal_describeTopLayer(&ctm, &clip_bounds);
+
+ return platform_device->BeginPlatformPaint(ctm, clip_bounds);
+}
+
HDC BitmapPlatformDevice::GetBitmapDC(const SkMatrix& transform,
const SkIRect& clip_bounds) {
if (!hdc_) {
« no previous file with comments | « skia/ext/bitmap_platform_device_mac_unittest.cc ('k') | skia/ext/platform_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698