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

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

Issue 402613006: Fixing 2D canvas invalidation region tracking. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixups and baselines Created 6 years, 5 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 | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferClient.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 { 116 {
117 return m_surface->isValid() || m_surface->restore(); 117 return m_surface->isValid() || m_surface->restore();
118 } 118 }
119 119
120 void ImageBuffer::notifySurfaceInvalid() 120 void ImageBuffer::notifySurfaceInvalid()
121 { 121 {
122 if (m_client) 122 if (m_client)
123 m_client->notifySurfaceInvalid(); 123 m_client->notifySurfaceInvalid();
124 } 124 }
125 125
126 void ImageBuffer::didPresent()
127 {
128 if (m_client)
129 m_client->didPresent();
130 }
131
126 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) 132 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap)
127 { 133 {
128 SkBitmap tmp; 134 SkBitmap tmp;
129 if (!bitmap.deepCopyTo(&tmp)) 135 if (!bitmap.deepCopyTo(&tmp))
130 bitmap.copyTo(&tmp, bitmap.colorType()); 136 bitmap.copyTo(&tmp, bitmap.colorType());
131 137
132 return tmp; 138 return tmp;
133 } 139 }
134 140
135 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh avior) const 141 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh avior) const
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) 415 if (!encodeImage(imageData, mimeType, quality, &encodedImage))
410 return "data:,"; 416 return "data:,";
411 417
412 Vector<char> base64Data; 418 Vector<char> base64Data;
413 base64Encode(encodedImage, base64Data); 419 base64Encode(encodedImage, base64Data);
414 420
415 return "data:" + mimeType + ";base64," + base64Data; 421 return "data:" + mimeType + ";base64," + base64Data;
416 } 422 }
417 423
418 } // namespace WebCore 424 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698