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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 1447273003: Make the FloatSize constructor from an IntSize explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 251
252 return drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_RGBA, 252 return drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_RGBA,
253 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer); 253 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer);
254 } 254 }
255 255
256 void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons t FloatRect* srcPtr, SkXfermode::Mode op) 256 void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons t FloatRect* srcPtr, SkXfermode::Mode op)
257 { 257 {
258 if (!isSurfaceValid()) 258 if (!isSurfaceValid())
259 return; 259 return;
260 260
261 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), size()); 261 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), FloatSize(siz e()));
262 m_surface->draw(context, destRect, srcRect, op); 262 m_surface->draw(context, destRect, srcRect, op);
263 } 263 }
264 264
265 void ImageBuffer::flush() 265 void ImageBuffer::flush()
266 { 266 {
267 if (m_surface->canvas()) { 267 if (m_surface->canvas()) {
268 m_surface->flush(); 268 m_surface->flush();
269 } 269 }
270 } 270 }
271 271
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 373 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
374 374
375 Vector<unsigned char> result; 375 Vector<unsigned char> result;
376 if (!encodeImage(mimeType, quality, &result)) 376 if (!encodeImage(mimeType, quality, &result))
377 return "data:,"; 377 return "data:,";
378 378
379 return "data:" + mimeType + ";base64," + base64Encode(result); 379 return "data:" + mimeType + ";base64," + base64Encode(result);
380 } 380 }
381 381
382 } // namespace blink 382 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698