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

Side by Side Diff: ui/gfx/blit.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 | « ui/base/clipboard/clipboard_win.cc ('k') | ui/gfx/native_widget_types.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 "ui/gfx/blit.h" 5 #include "ui/gfx/blit.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 void ScrollCanvas(SkCanvas* canvas, 70 void ScrollCanvas(SkCanvas* canvas,
71 const gfx::Rect& in_clip, 71 const gfx::Rect& in_clip,
72 const gfx::Vector2d& offset) { 72 const gfx::Vector2d& offset) {
73 DCHECK(!HasClipOrTransform(*canvas)); // Don't support special stuff. 73 DCHECK(!HasClipOrTransform(*canvas)); // Don't support special stuff.
74 #if defined(OS_WIN) 74 #if defined(OS_WIN)
75 // If we have a PlatformCanvas, we should use ScrollDC. Otherwise, fall 75 // If we have a PlatformCanvas, we should use ScrollDC. Otherwise, fall
76 // through to the software implementation. 76 // through to the software implementation.
77 if (skia::SupportsPlatformPaint(canvas)) { 77 if (skia::SupportsPlatformPaint(canvas)) {
78 skia::ScopedPlatformPaint scoped_platform_paint(canvas); 78 skia::ScopedPlatformPaint scoped_platform_paint(canvas);
79 HDC hdc = scoped_platform_paint.GetPlatformSurface(); 79 HDC hdc = scoped_platform_paint.GetNativeDrawingContext();
80 80
81 RECT damaged_rect; 81 RECT damaged_rect;
82 RECT r = in_clip.ToRECT(); 82 RECT r = in_clip.ToRECT();
83 ScrollDC(hdc, offset.x(), offset.y(), NULL, &r, NULL, &damaged_rect); 83 ScrollDC(hdc, offset.x(), offset.y(), NULL, &r, NULL, &damaged_rect);
84 return; 84 return;
85 } 85 }
86 #endif // defined(OS_WIN) 86 #endif // defined(OS_WIN)
87 // For non-windows, always do scrolling in software. 87 // For non-windows, always do scrolling in software.
88 // Cairo has no nice scroll function so we do our own. On Mac it's possible to 88 // Cairo has no nice scroll function so we do our own. On Mac it's possible to
89 // use platform scroll code, but it's complex so we just use the same path 89 // use platform scroll code, but it's complex so we just use the same path
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // Fortunately, memmove already handles this for us. 124 // Fortunately, memmove already handles this for us.
125 for (int y = 0; y < dest_rect.height(); y++) { 125 for (int y = 0; y < dest_rect.height(); y++) {
126 memmove(pixmap.writable_addr32(dest_rect.x(), dest_rect.y() + y), 126 memmove(pixmap.writable_addr32(dest_rect.x(), dest_rect.y() + y),
127 pixmap.addr32(src_rect.x(), src_rect.y() + y), 127 pixmap.addr32(src_rect.x(), src_rect.y() + y),
128 row_bytes); 128 row_bytes);
129 } 129 }
130 } 130 }
131 } 131 }
132 132
133 } // namespace gfx 133 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_win.cc ('k') | ui/gfx/native_widget_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698