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

Unified Diff: content/browser/compositor/software_output_device_win.cc

Issue 2610323004: Remove skia::DrawToNativeContext() (Closed)
Patch Set: missing header 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 | « no previous file | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/software_output_device_win.cc
diff --git a/content/browser/compositor/software_output_device_win.cc b/content/browser/compositor/software_output_device_win.cc
index 0a1bc209898e00193dd8bb52d6f9fdf6fa3510b6..4cb2d876d847a429a32d02b71699b06780237303 100644
--- a/content/browser/compositor/software_output_device_win.cc
+++ b/content/browser/compositor/software_output_device_win.cc
@@ -9,6 +9,7 @@
#include "cc/resources/shared_bitmap.h"
#include "content/public/browser/browser_thread.h"
#include "skia/ext/platform_canvas.h"
+#include "skia/ext/skia_utils_win.h"
#include "ui/compositor/compositor.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/skia_util.h"
@@ -165,6 +166,8 @@ void SoftwareOutputDeviceWin::EndPaint() {
if (rect.IsEmpty())
return;
+ HDC dib_dc = skia::GetNativeDrawingContext(contents_.get());
+
if (is_hwnd_composited_) {
RECT wr;
GetWindowRect(hwnd_, &wr);
@@ -178,14 +181,19 @@ void SoftwareOutputDeviceWin::EndPaint() {
style |= WS_EX_LAYERED;
SetWindowLong(hwnd_, GWL_EXSTYLE, style);
- HDC dib_dc = skia::GetNativeDrawingContext(contents_.get());
::UpdateLayeredWindow(hwnd_, NULL, &position, &size, dib_dc, &zero,
RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA);
} else {
HDC hdc = ::GetDC(hwnd_);
RECT src_rect = rect.ToRECT();
- skia::DrawToNativeContext(contents_.get(), hdc, rect.x(), rect.y(),
- &src_rect);
+ skia::CopyHDC(dib_dc,
+ hdc,
+ rect.x(),
+ rect.y(),
+ contents_.get()->imageInfo().isOpaque(),
+ src_rect,
+ contents_.get()->getTotalMatrix());
+
::ReleaseDC(hwnd_, hdc);
}
}
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698