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

Side by Side Diff: content/common/gpu/image_transport_surface_iosurface_mac.cc

Issue 753933002: MacViews: Move content::AcceleratedWidget to new component, ui/accelerated_widget_mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20141124-MacViews-MoveSoftwareLayerMac-fromcl
Patch Set: gn check 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
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 "content/common/gpu/image_transport_surface_iosurface_mac.h" 5 #include "content/common/gpu/image_transport_surface_iosurface_mac.h"
6 6
7 #include "content/common/gpu/gpu_messages.h" 7 #include "content/common/gpu/gpu_messages.h"
8 #include "content/common/gpu/surface_handle_types_mac.h" 8 #include "ui/accelerated_widget_mac/surface_handle_types.h"
9 9
10 namespace content { 10 namespace content {
11 namespace { 11 namespace {
12 12
13 // IOSurface dimensions will be rounded up to a multiple of this value in order 13 // IOSurface dimensions will be rounded up to a multiple of this value in order
14 // to reduce memory thrashing during resize. This must be a power of 2. 14 // to reduce memory thrashing during resize. This must be a power of 2.
15 const uint32 kIOSurfaceDimensionRoundup = 64; 15 const uint32 kIOSurfaceDimensionRoundup = 64;
16 16
17 int RoundUpSurfaceDimension(int number) { 17 int RoundUpSurfaceDimension(int number) {
18 DCHECK(number >= 0); 18 DCHECK(number >= 0);
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void IOSurfaceStorageProvider::SwapBuffers( 108 void IOSurfaceStorageProvider::SwapBuffers(
109 const gfx::Size& size, float scale_factor) { 109 const gfx::Size& size, float scale_factor) {
110 // The browser compositor will throttle itself, so we are free to unblock the 110 // The browser compositor will throttle itself, so we are free to unblock the
111 // context immediately. Make sure that the browser is doing its throttling 111 // context immediately. Make sure that the browser is doing its throttling
112 // appropriately by ensuring that the previous swap was acknowledged before 112 // appropriately by ensuring that the previous swap was acknowledged before
113 // we get another swap. 113 // we get another swap.
114 DCHECK(pending_swapped_surfaces_.empty()); 114 DCHECK(pending_swapped_surfaces_.empty());
115 pending_swapped_surfaces_.push_back(io_surface_); 115 pending_swapped_surfaces_.push_back(io_surface_);
116 116
117 transport_surface_->SendSwapBuffers( 117 transport_surface_->SendSwapBuffers(
118 SurfaceHandleFromIOSurfaceID(io_surface_id_), size, scale_factor); 118 ui::SurfaceHandleFromIOSurfaceID(io_surface_id_), size, scale_factor);
119 } 119 }
120 120
121 void IOSurfaceStorageProvider::WillWriteToBackbuffer() { 121 void IOSurfaceStorageProvider::WillWriteToBackbuffer() {
122 } 122 }
123 123
124 void IOSurfaceStorageProvider::DiscardBackbuffer() { 124 void IOSurfaceStorageProvider::DiscardBackbuffer() {
125 } 125 }
126 126
127 void IOSurfaceStorageProvider::SwapBuffersAckedByBrowser( 127 void IOSurfaceStorageProvider::SwapBuffersAckedByBrowser(
128 bool disable_throttling) { 128 bool disable_throttling) {
129 DCHECK(!pending_swapped_surfaces_.empty()); 129 DCHECK(!pending_swapped_surfaces_.empty());
130 pending_swapped_surfaces_.pop_front(); 130 pending_swapped_surfaces_.pop_front();
131 } 131 }
132 132
133 } // namespace content 133 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/image_transport_surface_calayer_mac.mm ('k') | content/common/gpu/surface_handle_types_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698