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

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

Issue 1145843003: Fix Slimming Paint WebGL printing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Agreed upon version Created 5 years, 7 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) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 1053
1054 m_canvas->writePixels(info, pixels, rowBytes, x, y); 1054 m_canvas->writePixels(info, pixels, rowBytes, x, y);
1055 } 1055 }
1056 1056
1057 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, 1057 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
1058 const SkRect& dst, const SkPaint* paint) 1058 const SkRect& dst, const SkPaint* paint)
1059 { 1059 {
1060 // Textures are bound to the blink main-thread GrContext, which can not be 1060 // Textures are bound to the blink main-thread GrContext, which can not be
1061 // used on the compositor raster thread. 1061 // used on the compositor raster thread.
1062 // FIXME: Mailbox support would make this possible in the GPU-raster case. 1062 // FIXME: Mailbox support would make this possible in the GPU-raster case.
1063 ASSERT(!isRecording() || !bitmap.getTexture()); 1063 // If we're printing it is safe to access the texture because we are always
1064 // on main thread, even if the other conditions are not met.
1065 ASSERT(!isRecording() || !bitmap.getTexture() || printing());
1064 if (contextDisabled()) 1066 if (contextDisabled())
1065 return; 1067 return;
1066 1068
1067 SkCanvas::DrawBitmapRectFlags flags = 1069 SkCanvas::DrawBitmapRectFlags flags =
1068 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; 1070 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag;
1069 1071
1070 ASSERT(m_canvas); 1072 ASSERT(m_canvas);
1071 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); 1073 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags);
1072 } 1074 }
1073 1075
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 // being returned from computeInterpolationQuality. 1719 // being returned from computeInterpolationQuality.
1718 resampling = InterpolationLow; 1720 resampling = InterpolationLow;
1719 } 1721 }
1720 resampling = limitInterpolationQuality(this, resampling); 1722 resampling = limitInterpolationQuality(this, resampling);
1721 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); 1723 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling));
1722 1724
1723 return initialSaveCount; 1725 return initialSaveCount;
1724 } 1726 }
1725 1727
1726 } // namespace blink 1728 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/platform/graphics/paint/DisplayItemListContextRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698