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

Side by Side Diff: ui/gfx/blit.cc

Issue 1138753003: Remove unused blitting functions from ui/gfx/blit.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/gfx/blit.h ('k') | no next file » | 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 "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "skia/ext/platform_canvas.h" 9 #include "skia/ext/platform_canvas.h"
10 #include "ui/gfx/geometry/point.h" 10 #include "ui/gfx/geometry/point.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 base::ScopedCFTypeRef<CGImageRef> src_image( 81 base::ScopedCFTypeRef<CGImageRef> src_image(
82 CGBitmapContextCreateImage(src_context)); 82 CGBitmapContextCreateImage(src_context));
83 base::ScopedCFTypeRef<CGImageRef> src_sub_image( 83 base::ScopedCFTypeRef<CGImageRef> src_sub_image(
84 CGImageCreateWithImageInRect(src_image, src_rect.ToCGRect())); 84 CGImageCreateWithImageInRect(src_image, src_rect.ToCGRect()));
85 CGContextDrawImage(dst_context, dst_rect.ToCGRect(), src_sub_image); 85 CGContextDrawImage(dst_context, dst_rect.ToCGRect(), src_sub_image);
86 NOTIMPLEMENTED(); 86 NOTIMPLEMENTED();
87 #endif 87 #endif
88 } 88 }
89 89
90 void BlitContextToCanvas(SkCanvas *dst_canvas,
91 const Rect& dst_rect,
92 NativeDrawingContext src_context,
93 const Point& src_origin) {
94 DCHECK(skia::SupportsPlatformPaint(dst_canvas));
95 BlitContextToContext(skia::BeginPlatformPaint(dst_canvas), dst_rect,
96 src_context, src_origin);
97 skia::EndPlatformPaint(dst_canvas);
98 }
99
100 void BlitCanvasToContext(NativeDrawingContext dst_context,
101 const Rect& dst_rect,
102 SkCanvas *src_canvas,
103 const Point& src_origin) {
104 DCHECK(skia::SupportsPlatformPaint(src_canvas));
105 BlitContextToContext(dst_context, dst_rect,
106 skia::BeginPlatformPaint(src_canvas), src_origin);
107 skia::EndPlatformPaint(src_canvas);
108 }
109
110 void BlitCanvasToCanvas(SkCanvas *dst_canvas, 90 void BlitCanvasToCanvas(SkCanvas *dst_canvas,
111 const Rect& dst_rect, 91 const Rect& dst_rect,
112 SkCanvas *src_canvas, 92 SkCanvas *src_canvas,
113 const Point& src_origin) { 93 const Point& src_origin) {
114 DCHECK(skia::SupportsPlatformPaint(dst_canvas)); 94 DCHECK(skia::SupportsPlatformPaint(dst_canvas));
115 DCHECK(skia::SupportsPlatformPaint(src_canvas)); 95 DCHECK(skia::SupportsPlatformPaint(src_canvas));
116 BlitContextToContext(skia::BeginPlatformPaint(dst_canvas), dst_rect, 96 BlitContextToContext(skia::BeginPlatformPaint(dst_canvas), dst_rect,
117 skia::BeginPlatformPaint(src_canvas), src_origin); 97 skia::BeginPlatformPaint(src_canvas), src_origin);
118 skia::EndPlatformPaint(src_canvas); 98 skia::EndPlatformPaint(src_canvas);
119 skia::EndPlatformPaint(dst_canvas); 99 skia::EndPlatformPaint(dst_canvas);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Fortunately, memmove already handles this for us. 157 // Fortunately, memmove already handles this for us.
178 for (int y = 0; y < dest_rect.height(); y++) { 158 for (int y = 0; y < dest_rect.height(); y++) {
179 memmove(bitmap.getAddr32(dest_rect.x(), dest_rect.y() + y), 159 memmove(bitmap.getAddr32(dest_rect.x(), dest_rect.y() + y),
180 bitmap.getAddr32(src_rect.x(), src_rect.y() + y), 160 bitmap.getAddr32(src_rect.x(), src_rect.y() + y),
181 row_bytes); 161 row_bytes);
182 } 162 }
183 } 163 }
184 } 164 }
185 165
186 } // namespace gfx 166 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/blit.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698