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

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

Issue 1297663002: Eliminate deferral overhead with canvas to canvas draws (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl web Created 5 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferSurface.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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 { 86 {
87 } 87 }
88 88
89 SkCanvas* ImageBuffer::canvas() const 89 SkCanvas* ImageBuffer::canvas() const
90 { 90 {
91 if (!isSurfaceValid()) 91 if (!isSurfaceValid())
92 return nullptr; 92 return nullptr;
93 return m_surface->canvas(); 93 return m_surface->canvas();
94 } 94 }
95 95
96 SkCanvas* ImageBuffer::immediateCanvas() const 96 void ImageBuffer::disableDeferral() const
97 { 97 {
98 if (!isSurfaceValid()) 98 return m_surface->disableDeferral();
99 return nullptr;
100 return m_surface->immediateCanvas();
101 } 99 }
102 100
103 bool ImageBuffer::writePixels(const SkImageInfo& info, const void* pixels, size_ t rowBytes, int x, int y) 101 bool ImageBuffer::writePixels(const SkImageInfo& info, const void* pixels, size_ t rowBytes, int x, int y)
104 { 102 {
105 return m_surface->writePixels(info, pixels, rowBytes, x, y); 103 return m_surface->writePixels(info, pixels, rowBytes, x, y);
106 } 104 }
107 105
108 const SkBitmap& ImageBuffer::deprecatedBitmapForOverwrite() const 106 const SkBitmap& ImageBuffer::deprecatedBitmapForOverwrite() const
109 { 107 {
110 return m_surface->deprecatedBitmapForOverwrite(); 108 return m_surface->deprecatedBitmapForOverwrite();
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 362 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
365 363
366 Vector<char> encodedImage; 364 Vector<char> encodedImage;
367 if (!encodeImage(*this, mimeType, quality, &encodedImage)) 365 if (!encodeImage(*this, mimeType, quality, &encodedImage))
368 return "data:,"; 366 return "data:,";
369 367
370 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); 368 return "data:" + mimeType + ";base64," + base64Encode(encodedImage);
371 } 369 }
372 370
373 } // namespace blink 371 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698