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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 1196683003: remove SkDeviceProperties (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up Created 5 years, 6 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
« src/gpu/SkGpuDevice.h ('K') | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkSurface_Gpu.h" 8 #include "SkSurface_Gpu.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 14 matching lines...) Expand all
25 25
26 SkSurface_Gpu::~SkSurface_Gpu() { 26 SkSurface_Gpu::~SkSurface_Gpu() {
27 fDevice->unref(); 27 fDevice->unref();
28 } 28 }
29 29
30 SkCanvas* SkSurface_Gpu::onNewCanvas() { 30 SkCanvas* SkSurface_Gpu::onNewCanvas() {
31 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags; 31 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags;
32 // When we think this works... 32 // When we think this works...
33 // flags |= SkCanvas::kConservativeRasterClip_InitFlag; 33 // flags |= SkCanvas::kConservativeRasterClip_InitFlag;
34 34
35 return SkNEW_ARGS(SkCanvas, (fDevice, &this->props(), flags)); 35 return SkNEW_ARGS(SkCanvas, (fDevice, flags));
36 } 36 }
37 37
38 SkSurface* SkSurface_Gpu::onNewSurface(const SkImageInfo& info) { 38 SkSurface* SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
39 GrRenderTarget* rt = fDevice->accessRenderTarget(); 39 GrRenderTarget* rt = fDevice->accessRenderTarget();
40 int sampleCount = rt->numColorSamples(); 40 int sampleCount = rt->numColorSamples();
41 // TODO: Make caller specify this (change virtual signature of onNewSurface) . 41 // TODO: Make caller specify this (change virtual signature of onNewSurface) .
42 static const Budgeted kBudgeted = kNo_Budgeted; 42 static const Budgeted kBudgeted = kNo_Budgeted;
43 return SkSurface::NewRenderTarget(fDevice->context(), kBudgeted, info, sampl eCount, 43 return SkSurface::NewRenderTarget(fDevice->context(), kBudgeted, info, sampl eCount,
44 &this->props()); 44 &this->props());
45 } 45 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 return NULL; 115 return NULL;
116 } 116 }
117 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget (), props)); 117 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(surface->asRenderTarget (), props));
118 if (!device) { 118 if (!device) {
119 return NULL; 119 return NULL;
120 } 120 }
121 return SkNEW_ARGS(SkSurface_Gpu, (device)); 121 return SkNEW_ARGS(SkSurface_Gpu, (device));
122 } 122 }
123 123
124 #endif 124 #endif
OLDNEW
« src/gpu/SkGpuDevice.h ('K') | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698