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

Side by Side Diff: content/renderer/android/synchronous_compositor_proxy.cc

Issue 2355583002: stop using (deprecated) setClipRegion, add flag for new clipop type (Closed)
Patch Set: rename to DrawRectWithColor Created 4 years, 3 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 | skia/config/SkUserConfig.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/android/synchronous_compositor_proxy.h" 5 #include "content/renderer/android/synchronous_compositor_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "cc/ipc/cc_param_traits.h" 10 #include "cc/ipc/cc_param_traits.h"
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 SkImageInfo info = 306 SkImageInfo info =
307 SkImageInfo::MakeN32Premul(params.size.width(), params.size.height()); 307 SkImageInfo::MakeN32Premul(params.size.width(), params.size.height());
308 size_t stride = info.minRowBytes(); 308 size_t stride = info.minRowBytes();
309 size_t buffer_size = info.getSafeSize(stride); 309 size_t buffer_size = info.getSafeSize(stride);
310 DCHECK_EQ(software_draw_shm_->buffer_size, buffer_size); 310 DCHECK_EQ(software_draw_shm_->buffer_size, buffer_size);
311 311
312 SkBitmap bitmap; 312 SkBitmap bitmap;
313 if (!bitmap.installPixels(info, software_draw_shm_->shm.memory(), stride)) 313 if (!bitmap.installPixels(info, software_draw_shm_->shm.memory(), stride))
314 return; 314 return;
315 SkCanvas canvas(bitmap); 315 SkCanvas canvas(bitmap);
316 canvas.setMatrix(params.transform.matrix()); 316 canvas.concat(params.transform.matrix());
317 canvas.setClipRegion(SkRegion(gfx::RectToSkIRect(params.clip))); 317 canvas.clipRect(gfx::RectToSkRect(params.clip));
318 318
319 compositor_frame_sink_->DemandDrawSw(&canvas); 319 compositor_frame_sink_->DemandDrawSw(&canvas);
320 } 320 }
321 321
322 void SynchronousCompositorProxy::SwapBuffersSw(cc::CompositorFrame frame) { 322 void SynchronousCompositorProxy::SwapBuffersSw(cc::CompositorFrame frame) {
323 DCHECK(inside_receive_); 323 DCHECK(inside_receive_);
324 DCHECK(software_draw_reply_); 324 DCHECK(software_draw_reply_);
325 SendDemandDrawSwReply(true, std::move(frame), software_draw_reply_); 325 SendDemandDrawSwReply(true, std::move(frame), software_draw_reply_);
326 inside_receive_ = false; 326 inside_receive_ = false;
327 } 327 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 374
375 void SynchronousCompositorProxy::SetScroll( 375 void SynchronousCompositorProxy::SetScroll(
376 const gfx::ScrollOffset& new_total_scroll_offset) { 376 const gfx::ScrollOffset& new_total_scroll_offset) {
377 if (total_scroll_offset_ == new_total_scroll_offset) 377 if (total_scroll_offset_ == new_total_scroll_offset)
378 return; 378 return;
379 total_scroll_offset_ = new_total_scroll_offset; 379 total_scroll_offset_ = new_total_scroll_offset;
380 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_); 380 input_handler_proxy_->SynchronouslySetRootScrollOffset(total_scroll_offset_);
381 } 381 }
382 382
383 } // namespace content 383 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | skia/config/SkUserConfig.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698