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

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: rebase 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 size_t rowBytes, 141 size_t rowBytes,
142 int x, 142 int x,
143 int y) { 143 int y) {
144 return m_surface->writePixels(info, pixels, rowBytes, x, y); 144 return m_surface->writePixels(info, pixels, rowBytes, x, y);
145 } 145 }
146 146
147 bool ImageBuffer::isSurfaceValid() const { 147 bool ImageBuffer::isSurfaceValid() const {
148 return m_surface->isValid(); 148 return m_surface->isValid();
149 } 149 }
150 150
151 bool ImageBuffer::isDirty() { 151 void ImageBuffer::finalizeFrame() {
152 return m_client ? m_client->isDirty() : false; 152 m_surface->finalizeFrame();
153 } 153 }
154 154
155 void ImageBuffer::didFinalizeFrame() { 155 void ImageBuffer::doPaintInvalidation(const FloatRect& dirtyRect) {
156 if (m_client) 156 m_surface->doPaintInvalidation(dirtyRect);
157 m_client->didFinalizeFrame();
158 }
159
160 void ImageBuffer::finalizeFrame(const FloatRect& dirtyRect) {
161 m_surface->finalizeFrame(dirtyRect);
162 didFinalizeFrame();
163 } 157 }
164 158
165 bool ImageBuffer::restoreSurface() const { 159 bool ImageBuffer::restoreSurface() const {
166 return m_surface->isValid() || m_surface->restore(); 160 return m_surface->isValid() || m_surface->restore();
167 } 161 }
168 162
169 void ImageBuffer::notifySurfaceInvalid() { 163 void ImageBuffer::notifySurfaceInvalid() {
170 if (m_client) 164 if (m_client)
171 m_client->notifySurfaceInvalid(); 165 m_client->notifySurfaceInvalid();
172 } 166 }
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 608 DCHECK(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
615 609
616 Vector<unsigned char> result; 610 Vector<unsigned char> result;
617 if (!encodeImage(mimeType, quality, &result)) 611 if (!encodeImage(mimeType, quality, &result))
618 return "data:,"; 612 return "data:,";
619 613
620 return "data:" + mimeType + ";base64," + base64Encode(result); 614 return "data:" + mimeType + ";base64," + base64Encode(result);
621 } 615 }
622 616
623 } // namespace blink 617 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698