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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1144153007: Fallback bitmap devices should observe the computed pixel geometry (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « no previous file | 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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasPriv.h" 9 #include "SkCanvasPriv.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
11 #include "SkColorFilter.h" 11 #include "SkColorFilter.h"
12 #include "SkDeviceImageFilterProxy.h" 12 #include "SkDeviceImageFilterProxy.h"
13 #include "SkDeviceProperties.h"
13 #include "SkDraw.h" 14 #include "SkDraw.h"
14 #include "SkDrawable.h" 15 #include "SkDrawable.h"
15 #include "SkDrawFilter.h" 16 #include "SkDrawFilter.h"
16 #include "SkDrawLooper.h" 17 #include "SkDrawLooper.h"
17 #include "SkErrorInternals.h" 18 #include "SkErrorInternals.h"
18 #include "SkImage.h" 19 #include "SkImage.h"
19 #include "SkMetaData.h" 20 #include "SkMetaData.h"
20 #include "SkPathOps.h" 21 #include "SkPathOps.h"
21 #include "SkPatchUtils.h" 22 #include "SkPatchUtils.h"
22 #include "SkPicture.h" 23 #include "SkPicture.h"
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 return; 1031 return;
1031 } 1032 }
1032 1033
1033 bool forceSpriteOnRestore = false; 1034 bool forceSpriteOnRestore = false;
1034 { 1035 {
1035 const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage; 1036 const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage;
1036 const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(inf o, usage, geo); 1037 const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(inf o, usage, geo);
1037 SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint); 1038 SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint);
1038 if (NULL == newDev) { 1039 if (NULL == newDev) {
1039 // If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't h andle the paint) 1040 // If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't h andle the paint)
1040 newDev = SkBitmapDevice::Create(createInfo.fInfo); 1041 const SkDeviceProperties deviceProps(createInfo.fPixelGeometry);
1042 newDev = SkBitmapDevice::Create(createInfo.fInfo, &deviceProps);
1041 if (NULL == newDev) { 1043 if (NULL == newDev) {
1042 SkErrorInternals::SetError(kInternalError_SkError, 1044 SkErrorInternals::SetError(kInternalError_SkError,
1043 "Unable to create device for layer.") ; 1045 "Unable to create device for layer.") ;
1044 return; 1046 return;
1045 } 1047 }
1046 forceSpriteOnRestore = true; 1048 forceSpriteOnRestore = true;
1047 } 1049 }
1048 device = newDev; 1050 device = newDev;
1049 } 1051 }
1050 1052
(...skipping 1658 matching lines...) Expand 10 before | Expand all | Expand 10 after
2709 } 2711 }
2710 2712
2711 if (matrix) { 2713 if (matrix) {
2712 canvas->concat(*matrix); 2714 canvas->concat(*matrix);
2713 } 2715 }
2714 } 2716 }
2715 2717
2716 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2718 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2717 fCanvas->restoreToCount(fSaveCount); 2719 fCanvas->restoreToCount(fSaveCount);
2718 } 2720 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698