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

Side by Side Diff: webkit/port/platform/graphics/skia/ImageSkia.cpp

Issue 14110: Move the "platform" wrappers in skia/ext to the skia namespace. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2008, Google Inc. 1 // Copyright (c) 2008, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 void paintSkBitmap(PlatformContextSkia* platformContext, 238 void paintSkBitmap(PlatformContextSkia* platformContext,
239 const NativeImageSkia& bitmap, 239 const NativeImageSkia& bitmap,
240 const SkIRect& srcRect, 240 const SkIRect& srcRect,
241 const SkRect& destRect, 241 const SkRect& destRect,
242 const SkPorterDuff::Mode& compOp) 242 const SkPorterDuff::Mode& compOp)
243 { 243 {
244 SkPaint paint; 244 SkPaint paint;
245 paint.setPorterDuffXfermode(compOp); 245 paint.setPorterDuffXfermode(compOp);
246 246
247 gfx::PlatformCanvas* canvas = platformContext->canvas(); 247 skia::PlatformCanvas* canvas = platformContext->canvas();
248 248
249 ResamplingMode resampling = platformContext->IsPrinting() ? RESAMPLE_NONE : 249 ResamplingMode resampling = platformContext->IsPrinting() ? RESAMPLE_NONE :
250 computeResamplingMode(bitmap, srcRect.width(), srcRect.height(), 250 computeResamplingMode(bitmap, srcRect.width(), srcRect.height(),
251 SkScalarToFloat(destRect.width()), 251 SkScalarToFloat(destRect.width()),
252 SkScalarToFloat(destRect.height())); 252 SkScalarToFloat(destRect.height()));
253 if (resampling == RESAMPLE_AWESOME) { 253 if (resampling == RESAMPLE_AWESOME) {
254 paint.setFilterBitmap(false); 254 paint.setFilterBitmap(false);
255 drawResampledBitmap(*canvas, paint, bitmap, srcRect, destRect); 255 drawResampledBitmap(*canvas, paint, bitmap, srcRect, destRect);
256 } else { 256 } else {
257 // No resampling necessary, we can just draw the bitmap. We want to 257 // No resampling necessary, we can just draw the bitmap. We want to
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create( 447 PassRefPtr<BitmapImageSingleFrameSkia> BitmapImageSingleFrameSkia::create(
448 const SkBitmap& bitmap) 448 const SkBitmap& bitmap)
449 { 449 {
450 RefPtr<BitmapImageSingleFrameSkia> image(new BitmapImageSingleFrameSkia()); 450 RefPtr<BitmapImageSingleFrameSkia> image(new BitmapImageSingleFrameSkia());
451 if (!bitmap.copyTo(&image->m_nativeImage, bitmap.config())) 451 if (!bitmap.copyTo(&image->m_nativeImage, bitmap.config()))
452 return 0; 452 return 0;
453 return image.release(); 453 return image.release();
454 } 454 }
455 455
456 } // namespace WebCore 456 } // namespace WebCore
OLDNEW
« no previous file with comments | « webkit/port/platform/graphics/chromium/ImageBufferData.h ('k') | webkit/port/platform/graphics/skia/PlatformContextSkia.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698