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

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

Issue 2653933003: Make stream captures work on canvases that are not in the DOM. (Closed)
Patch Set: Created 3 years, 10 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
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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 size_t rowBytes, 135 size_t rowBytes,
136 int x, 136 int x,
137 int y) { 137 int y) {
138 return m_surface->writePixels(info, pixels, rowBytes, x, y); 138 return m_surface->writePixels(info, pixels, rowBytes, x, y);
139 } 139 }
140 140
141 bool ImageBuffer::isSurfaceValid() const { 141 bool ImageBuffer::isSurfaceValid() const {
142 return m_surface->isValid(); 142 return m_surface->isValid();
143 } 143 }
144 144
145 bool ImageBuffer::isDirty() { 145 void ImageBuffer::finalizeFrame() {
146 return m_client ? m_client->isDirty() : false; 146 m_surface->finalizeFrame();
147 } 147 }
148 148
149 void ImageBuffer::didFinalizeFrame() { 149 void ImageBuffer::doPaintInvalidation(const FloatRect& dirtyRect) {
150 if (m_client) 150 m_surface->doPaintInvalidation(dirtyRect);
151 m_client->didFinalizeFrame();
152 }
153
154 void ImageBuffer::finalizeFrame(const FloatRect& dirtyRect) {
155 m_surface->finalizeFrame(dirtyRect);
156 didFinalizeFrame();
157 } 151 }
158 152
159 bool ImageBuffer::restoreSurface() const { 153 bool ImageBuffer::restoreSurface() const {
160 return m_surface->isValid() || m_surface->restore(); 154 return m_surface->isValid() || m_surface->restore();
161 } 155 }
162 156
163 void ImageBuffer::notifySurfaceInvalid() { 157 void ImageBuffer::notifySurfaceInvalid() {
164 if (m_client) 158 if (m_client)
165 m_client->notifySurfaceInvalid(); 159 m_client->notifySurfaceInvalid();
166 } 160 }
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 562 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
569 563
570 Vector<unsigned char> result; 564 Vector<unsigned char> result;
571 if (!encodeImage(mimeType, quality, &result)) 565 if (!encodeImage(mimeType, quality, &result))
572 return "data:,"; 566 return "data:,";
573 567
574 return "data:" + mimeType + ";base64," + base64Encode(result); 568 return "data:" + mimeType + ";base64," + base64Encode(result);
575 } 569 }
576 570
577 } // namespace blink 571 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698