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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer Created 6 years, 10 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/gpu/SkGr.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Gpu.cpp
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 58f9ef34375d54853940ed44cb781e463c5ac80c..d46d8bc74b0fe748432c8d7249e1f9c6a1ce8327 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -14,7 +14,6 @@ class SkSurface_Gpu : public SkSurface_Base {
public:
SK_DECLARE_INST_COUNT(SkSurface_Gpu)
- SkSurface_Gpu(GrContext*, const SkImageInfo&, int sampleCount);
SkSurface_Gpu(GrRenderTarget*);
virtual ~SkSurface_Gpu();
@@ -33,18 +32,6 @@ private:
///////////////////////////////////////////////////////////////////////////////
-SkSurface_Gpu::SkSurface_Gpu(GrContext* ctx, const SkImageInfo& info,
- int sampleCount)
- : INHERITED(info.fWidth, info.fHeight) {
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
-
- fDevice = SkNEW_ARGS(SkGpuDevice, (ctx, config, info.fWidth, info.fHeight, sampleCount));
-
- if (!SkAlphaTypeIsOpaque(info.fAlphaType)) {
- fDevice->clear(0x0);
- }
-}
-
SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget)
: INHERITED(renderTarget->width(), renderTarget->height()) {
fDevice = SkNEW_ARGS(SkGpuDevice, (renderTarget->getContext(), renderTarget));
@@ -85,9 +72,10 @@ void SkSurface_Gpu::onCopyOnWrite(ContentChangeMode mode) {
// are we sharing our render target with the image?
SkASSERT(NULL != this->getCachedImage());
if (rt->asTexture() == SkTextureImageGetTexture(this->getCachedImage())) {
- SkAutoTUnref<SkGpuDevice> newDevice(SkNEW_ARGS(SkGpuDevice,
- (fDevice->context(), fDevice->config(), fDevice->width(),
- fDevice->height(), rt->numSamples())));
+ SkAutoTUnref<SkGpuDevice> newDevice(SkGpuDevice::Create(fDevice->context(),
+ fDevice->imageInfo(),
+ rt->numSamples()));
+ SkASSERT(newDevice.get());
if (kRetain_ContentChangeMode == mode) {
fDevice->context()->copyTexture(rt->asTexture(),
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698