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

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

Issue 799103002: Fix display list canvas not rendering correctly on high dpi displays (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update Created 6 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 /* 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 return result; 259 return result;
260 } 260 }
261 261
262 void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons t FloatRect* srcPtr, CompositeOperator op, WebBlendMode blendMode) 262 void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons t FloatRect* srcPtr, CompositeOperator op, WebBlendMode blendMode)
263 { 263 {
264 if (!isSurfaceValid()) 264 if (!isSurfaceValid())
265 return; 265 return;
266 266
267 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), size()); 267 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), size());
268 RefPtr<SkPicture> picture = m_surface->getPicture(); 268 RefPtr<SkPicture> picture = m_surface->getPicture();
Stephen White 2014/12/12 22:14:12 IWBN if the SkPicture-related stuff could all live
Justin Novosad 2014/12/12 22:31:51 Acknowledged.
269 if (picture) { 269 if (picture) {
270 context->drawPicture(picture.get(), destRect, srcRect, op, blendMode); 270 context->compositePicture(picture.get(), destRect, srcRect, op, blendMod e);
271 return; 271 return;
272 } 272 }
273 273
274 SkBitmap bitmap = m_surface->bitmap(); 274 SkBitmap bitmap = m_surface->bitmap();
275 // For ImageBufferSurface that enables cachedBitmap, Use the cached Bitmap f or CPU side usage 275 // For ImageBufferSurface that enables cachedBitmap, Use the cached Bitmap f or CPU side usage
276 // if it is available, otherwise generate and use it. 276 // if it is available, otherwise generate and use it.
277 if (!context->isAccelerated() && m_surface->isAccelerated() && m_surface->ca chedBitmapEnabled() && isSurfaceValid()) { 277 if (!context->isAccelerated() && m_surface->isAccelerated() && m_surface->ca chedBitmapEnabled() && isSurfaceValid()) {
278 m_surface->updateCachedBitmapIfNeeded(); 278 m_surface->updateCachedBitmapIfNeeded();
279 bitmap = m_surface->cachedBitmap(); 279 bitmap = m_surface->cachedBitmap();
280 } 280 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) con st 411 String ImageBuffer::toDataURL(const String& mimeType, const double* quality) con st
412 { 412 {
413 if (!isSurfaceValid()) 413 if (!isSurfaceValid())
414 return "data:,"; 414 return "data:,";
415 415
416 return ImageEncoder::toDataURL(m_surface->bitmap(), mimeType, quality); 416 return ImageEncoder::toDataURL(m_surface->bitmap(), mimeType, quality);
417 } 417 }
418 418
419 } // namespace blink 419 } // namespace blink
OLDNEW
« Source/platform/graphics/GraphicsContext.cpp ('K') | « Source/platform/graphics/GraphicsContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698