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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 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
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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 Platform3DObject textureId = m_surface->getBackingTextureHandleForOverwrite( ); 246 Platform3DObject textureId = m_surface->getBackingTextureHandleForOverwrite( );
247 if (!textureId) 247 if (!textureId)
248 return false; 248 return false;
249 249
250 context3D->flush(); 250 context3D->flush();
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(), FloatSize(siz e())); 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 {
(...skipping 106 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