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

Side by Side Diff: skia/ext/bitmap_platform_device_cairo.cc

Issue 773373002: Update from https://crrev.com/306706 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc ('k') | skia/ext/bitmap_platform_device_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "skia/ext/bitmap_platform_device_cairo.h" 5 #include "skia/ext/bitmap_platform_device_cairo.h"
6 #include "skia/ext/platform_canvas.h" 6 #include "skia/ext/platform_canvas.h"
7 7
8 #if defined(OS_OPENBSD) 8 #if defined(OS_OPENBSD)
9 #include <cairo.h> 9 #include <cairo.h>
10 #else 10 #else
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 120
121 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, 121 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
122 bool is_opaque) { 122 bool is_opaque) {
123 // This initializes the bitmap to all zeros. 123 // This initializes the bitmap to all zeros.
124 cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 124 cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
125 width, height); 125 width, height);
126 126
127 BitmapPlatformDevice* device = Create(width, height, is_opaque, surface); 127 BitmapPlatformDevice* device = Create(width, height, is_opaque, surface);
128 128
129 #ifndef NDEBUG 129 #ifndef NDEBUG
130 if (device && is_opaque) // Fill with bright bluish green 130 if (device && is_opaque) // Fill with bright bluish green
131 device->eraseColor(SkColorSetARGB(255, 0, 255, 128)); 131 SkCanvas(device).drawColor(0xFF00FF80);
132 #endif 132 #endif
133 133
134 return device; 134 return device;
135 } 135 }
136 136
137 BitmapPlatformDevice* BitmapPlatformDevice::CreateAndClear(int width, 137 BitmapPlatformDevice* BitmapPlatformDevice::CreateAndClear(int width,
138 int height, 138 int height,
139 bool is_opaque) { 139 bool is_opaque) {
140 // The Linux port always constructs initialized bitmaps, so there is no extra 140 // The Linux port always constructs initialized bitmaps, so there is no extra
141 // work to perform here. 141 // work to perform here.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 width, 222 width,
223 height); 223 height);
224 if (cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) { 224 if (cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) {
225 cairo_surface_destroy(surf); 225 cairo_surface_destroy(surf);
226 return false; 226 return false;
227 } 227 }
228 return InstallCairoSurfacePixels(&bitmap_, surf, is_opaque); 228 return InstallCairoSurfacePixels(&bitmap_, surf, is_opaque);
229 } 229 }
230 230
231 } // namespace skia 231 } // namespace skia
OLDNEW
« no previous file with comments | « sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc ('k') | skia/ext/bitmap_platform_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698