| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 * | 7 * |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 #ifndef HelloWorld_DEFINED | 10 #ifndef HelloWorld_DEFINED |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Changes the device type of the object. | 30 // Changes the device type of the object. |
| 31 bool setUpBackend(); | 31 bool setUpBackend(); |
| 32 | 32 |
| 33 DeviceType getDeviceType() const { return fType; } | 33 DeviceType getDeviceType() const { return fType; } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 SkSurface* createSurface() override { | 36 SkSurface* createSurface() override { |
| 37 SkSurfaceProps props(INHERITED::getSurfaceProps()); | 37 SkSurfaceProps props(INHERITED::getSurfaceProps()); |
| 38 if (kGPU_DeviceType == fType) { | 38 if (kGPU_DeviceType == fType) { |
| 39 return SkSurface::MakeRenderTargetDirect(fRenderTarget, &props).rele
ase(); | 39 return SkSurface::MakeRenderTargetDirect(fRenderTarget, nullptr, &pr
ops).release(); |
| 40 } | 40 } |
| 41 static const SkImageInfo info = SkImageInfo::MakeN32Premul( | 41 static const SkImageInfo info = SkImageInfo::MakeN32Premul( |
| 42 SkScalarRoundToInt(this->width()), SkScalarRoundToInt(this->heig
ht())); | 42 SkScalarRoundToInt(this->width()), SkScalarRoundToInt(this->heig
ht())); |
| 43 return fSurface = SkSurface::MakeRaster(info, &props).release(); | 43 return fSurface = SkSurface::MakeRaster(info, &props).release(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void draw(SkCanvas* canvas) override; | 46 void draw(SkCanvas* canvas) override; |
| 47 void drawContents(SkCanvas* canvas); | 47 void drawContents(SkCanvas* canvas); |
| 48 | 48 |
| 49 void onSizeChange() override; | 49 void onSizeChange() override; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 63 SkSurface* fSurface; | 63 SkSurface* fSurface; |
| 64 GrContext* fContext; | 64 GrContext* fContext; |
| 65 GrRenderTarget* fRenderTarget; | 65 GrRenderTarget* fRenderTarget; |
| 66 AttachmentInfo fAttachmentInfo; | 66 AttachmentInfo fAttachmentInfo; |
| 67 const GrGLInterface* fInterface; | 67 const GrGLInterface* fInterface; |
| 68 | 68 |
| 69 typedef SkOSWindow INHERITED; | 69 typedef SkOSWindow INHERITED; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 #endif | 72 #endif |
| OLD | NEW |