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

Side by Side Diff: Source/platform/graphics/UnacceleratedImageBufferSurface.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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy pe); 45 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy pe);
46 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); 46 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry);
47 m_surface = adoptRef(SkSurface::NewRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps)); 47 m_surface = adoptRef(SkSurface::NewRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps));
48 48
49 if (m_surface) 49 if (m_surface)
50 clear(); 50 clear();
51 } 51 }
52 52
53 UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() { } 53 UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() { }
54 54
55 SkCanvas* UnacceleratedImageBufferSurface::immediateCanvas() 55 SkCanvas* UnacceleratedImageBufferSurface::canvas()
56 { 56 {
57 return m_surface->getCanvas(); 57 return m_surface->getCanvas();
58 } 58 }
59 59
60 const SkBitmap& UnacceleratedImageBufferSurface::deprecatedBitmapForOverwrite() 60 const SkBitmap& UnacceleratedImageBufferSurface::deprecatedBitmapForOverwrite()
61 { 61 {
62 m_surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode); 62 m_surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
63 return m_surface->getCanvas()->getDevice()->accessBitmap(false); 63 return m_surface->getCanvas()->getDevice()->accessBitmap(false);
64 } 64 }
65 65
66 bool UnacceleratedImageBufferSurface::isValid() const 66 bool UnacceleratedImageBufferSurface::isValid() const
67 { 67 {
68 return m_surface; 68 return m_surface;
69 } 69 }
70 70
71 PassRefPtr<SkImage> UnacceleratedImageBufferSurface::newImageSnapshot() 71 PassRefPtr<SkImage> UnacceleratedImageBufferSurface::newImageSnapshot()
72 { 72 {
73 return adoptRef(m_surface->newImageSnapshot()); 73 return adoptRef(m_surface->newImageSnapshot());
74 } 74 }
75 75
76 } // namespace blink 76 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698