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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 14263017: Cleanup: Removing unnecessary args/complexity in SkSurface_Base and friends (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkSurface_Base.h ('k') | src/image/SkSurface_Picture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Gpu.cpp
===================================================================
--- src/image/SkSurface_Gpu.cpp (revision 8683)
+++ src/image/SkSurface_Gpu.cpp (working copy)
@@ -23,7 +23,7 @@
virtual SkImage* onNewImageSnapshot() SK_OVERRIDE;
virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y,
const SkPaint*) SK_OVERRIDE;
- virtual void onCopyOnWrite(SkImage*, SkCanvas*) SK_OVERRIDE;
+ virtual void onCopyOnWrite() SK_OVERRIDE;
private:
SkGpuDevice* fDevice;
@@ -86,20 +86,21 @@
// Create a new SkGpuDevice and, if necessary, copy the contents of the old
// device into it. Note that this flushes the SkGpuDevice but
// doesn't force an OpenGL flush.
-void SkSurface_Gpu::onCopyOnWrite(SkImage* image, SkCanvas* canvas) {
+void SkSurface_Gpu::onCopyOnWrite() {
GrRenderTarget* rt = (GrRenderTarget*) fDevice->accessRenderTarget();
// are we sharing our render target with the image?
- if (rt->asTexture() == SkTextureImageGetTexture(image)) {
+ SkASSERT(NULL != this->getCachedImage());
+ if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) {
SkGpuDevice* newDevice = static_cast<SkGpuDevice*>(
fDevice->createCompatibleDevice(fDevice->config(), fDevice->width(),
fDevice->height(), fDevice->isOpaque()));
SkAutoTUnref<SkGpuDevice> aurd(newDevice);
fDevice->context()->copyTexture(rt->asTexture(),
(GrRenderTarget*)newDevice->accessRenderTarget());
- SkASSERT(NULL != canvas);
- SkASSERT(canvas->getDevice() == fDevice);
- canvas->setDevice(newDevice);
+ SkASSERT(NULL != this->getCachedCanvas());
+ SkASSERT(this->getCachedCanvas()->getDevice() == fDevice);
+ this->getCachedCanvas()->setDevice(newDevice);
SkRefCnt_SafeAssign(fDevice, newDevice);
}
}
« no previous file with comments | « src/image/SkSurface_Base.h ('k') | src/image/SkSurface_Picture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698