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

Side by Side Diff: skia/ext/bitmap_platform_device_win.cc

Issue 2400873002: keep only one typedef for the native drawing context (Closed)
Patch Set: native_drawing_context.h Created 4 years, 2 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
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/native_drawing_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <windows.h> 5 #include <windows.h>
6 #include <psapi.h> 6 #include <psapi.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/debug/gdi_debug_util_win.h" 9 #include "base/debug/gdi_debug_util_win.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 26 matching lines...) Expand all
37 const RECT* src_rect) { 37 const RECT* src_rect) {
38 ScopedPlatformPaint p(canvas); 38 ScopedPlatformPaint p(canvas);
39 RECT temp_rect; 39 RECT temp_rect;
40 if (!src_rect) { 40 if (!src_rect) {
41 temp_rect.left = 0; 41 temp_rect.left = 0;
42 temp_rect.right = canvas->imageInfo().width(); 42 temp_rect.right = canvas->imageInfo().width();
43 temp_rect.top = 0; 43 temp_rect.top = 0;
44 temp_rect.bottom = canvas->imageInfo().height(); 44 temp_rect.bottom = canvas->imageInfo().height();
45 src_rect = &temp_rect; 45 src_rect = &temp_rect;
46 } 46 }
47 skia::CopyHDC(p.GetPlatformSurface(), destination_hdc, x, y, 47 skia::CopyHDC(p.GetNativeDrawingContext(), destination_hdc, x, y,
48 canvas->imageInfo().isOpaque(), *src_rect, 48 canvas->imageInfo().isOpaque(), *src_rect,
49 canvas->getTotalMatrix()); 49 canvas->getTotalMatrix());
50 } 50 }
51 51
52 HDC BitmapPlatformDevice::GetBitmapDC(const SkMatrix& transform, 52 HDC BitmapPlatformDevice::GetBitmapDC(const SkMatrix& transform,
53 const SkIRect& clip_bounds) { 53 const SkIRect& clip_bounds) {
54 if (!hdc_) { 54 if (!hdc_) {
55 hdc_ = CreateCompatibleDC(NULL); 55 hdc_ = CreateCompatibleDC(NULL);
56 InitializeDC(hdc_); 56 InitializeDC(hdc_);
57 old_hbitmap_ = static_cast<HBITMAP>(SelectObject(hdc_, hbitmap_)); 57 old_hbitmap_ = static_cast<HBITMAP>(SelectObject(hdc_, hbitmap_));
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 int height, 211 int height,
212 bool is_opaque, 212 bool is_opaque,
213 HANDLE shared_section, 213 HANDLE shared_section,
214 OnFailureType failureType) { 214 OnFailureType failureType) {
215 sk_sp<SkBaseDevice> dev( 215 sk_sp<SkBaseDevice> dev(
216 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section)); 216 BitmapPlatformDevice::Create(width, height, is_opaque, shared_section));
217 return CreateCanvas(dev, failureType); 217 return CreateCanvas(dev, failureType);
218 } 218 }
219 219
220 } // namespace skia 220 } // namespace skia
OLDNEW
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/native_drawing_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698