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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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) 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 if (isValid()) { 63 if (isValid()) {
64 if (m_opacityMode == Opaque) { 64 if (m_opacityMode == Opaque) {
65 canvas()->clear(SK_ColorBLACK); 65 canvas()->clear(SK_ColorBLACK);
66 } else { 66 } else {
67 canvas()->clear(SK_ColorTRANSPARENT); 67 canvas()->clear(SK_ColorTRANSPARENT);
68 } 68 }
69 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size()))); 69 didDraw(FloatRect(FloatPoint(0, 0), FloatSize(size())));
70 } 70 }
71 } 71 }
72 72
73 void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRec t, const FloatRect& srcRect, SkXfermode::Mode op) 73 void ImageBufferSurface::draw(GraphicsContext& context, const FloatRect& destRec t, const FloatRect& srcRect, SkXfermode::Mode op)
74 { 74 {
75 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration); 75 RefPtr<SkImage> snapshot = newImageSnapshot(PreferNoAcceleration);
76 if (!snapshot) 76 if (!snapshot)
77 return; 77 return;
78 78
79 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release()); 79 RefPtr<Image> image = StaticBitmapImage::create(snapshot.release());
80 context->drawImage(image.get(), destRect, srcRect, op); 80 context.drawImage(image.get(), destRect, srcRect, op);
81 } 81 }
82 82
83 void ImageBufferSurface::flush() 83 void ImageBufferSurface::flush()
84 { 84 {
85 canvas()->flush(); 85 canvas()->flush();
86 } 86 }
87 87
88 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi xels, size_t rowBytes, int x, int y) 88 bool ImageBufferSurface::writePixels(const SkImageInfo& origInfo, const void* pi xels, size_t rowBytes, int x, int y)
89 { 89 {
90 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y); 90 return canvas()->writePixels(origInfo, pixels, rowBytes, x, y);
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698