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

Side by Side Diff: ui/accelerated_widget_mac/accelerated_widget_mac.mm

Issue 1142113002: Remove SK_SUPPORT_LEGACY_PUBLIC_IMAGEINFO_FIELDS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 7 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 | « skia/config/SkUserConfig.h ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/accelerated_widget_mac/accelerated_widget_mac.h" 5 #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // If there is not a layer for software frames, create one. 277 // If there is not a layer for software frames, create one.
278 if (!software_layer_) { 278 if (!software_layer_) {
279 software_layer_.reset([[SoftwareLayer alloc] init]); 279 software_layer_.reset([[SoftwareLayer alloc] init]);
280 [flipped_layer_ addSublayer:software_layer_]; 280 [flipped_layer_ addSublayer:software_layer_];
281 } 281 }
282 282
283 // Set the software layer to draw the provided canvas. 283 // Set the software layer to draw the provided canvas.
284 SkImageInfo info; 284 SkImageInfo info;
285 size_t row_bytes; 285 size_t row_bytes;
286 const void* pixels = canvas->peekPixels(&info, &row_bytes); 286 const void* pixels = canvas->peekPixels(&info, &row_bytes);
287 gfx::Size pixel_size(info.fWidth, info.fHeight); 287 gfx::Size pixel_size(info.width(), info.height());
288 [software_layer_ setContentsToData:pixels 288 [software_layer_ setContentsToData:pixels
289 withRowBytes:row_bytes 289 withRowBytes:row_bytes
290 withPixelSize:pixel_size 290 withPixelSize:pixel_size
291 withScaleFactor:scale_factor]; 291 withScaleFactor:scale_factor];
292 last_swap_size_dip_ = gfx::ConvertSizeToDIP(scale_factor, pixel_size); 292 last_swap_size_dip_ = gfx::ConvertSizeToDIP(scale_factor, pixel_size);
293 293
294 // Remove any different-type layers that this is replacing. 294 // Remove any different-type layers that this is replacing.
295 DestroyCAContextLayer(ca_context_layer_); 295 DestroyCAContextLayer(ca_context_layer_);
296 DestroyIOSurfaceLayer(io_surface_layer_); 296 DestroyIOSurfaceLayer(io_surface_layer_);
297 } 297 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 378
379 void AcceleratedWidgetMacGotSoftwareFrame( 379 void AcceleratedWidgetMacGotSoftwareFrame(
380 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas) { 380 gfx::AcceleratedWidget widget, float scale_factor, SkCanvas* canvas) {
381 AcceleratedWidgetMac* accelerated_widget_mac = 381 AcceleratedWidgetMac* accelerated_widget_mac =
382 GetHelperFromAcceleratedWidget(widget); 382 GetHelperFromAcceleratedWidget(widget);
383 if (accelerated_widget_mac) 383 if (accelerated_widget_mac)
384 accelerated_widget_mac->GotSoftwareFrame(scale_factor, canvas); 384 accelerated_widget_mac->GotSoftwareFrame(scale_factor, canvas);
385 } 385 }
386 386
387 } // namespace ui 387 } // namespace ui
OLDNEW
« no previous file with comments | « skia/config/SkUserConfig.h ('k') | ui/gfx/ipc/gfx_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698