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

Side by Side Diff: cc/render_surface_filters.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/render_surface.cc ('k') | cc/render_surface_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/render_surface_filters.h" 5 #include "cc/render_surface_filters.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "skia/ext/refptr.h" 8 #include "skia/ext/refptr.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation. h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperation. h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 WebKit::WebFilterOperations RenderSurfaceFilters::Optimize( 312 WebKit::WebFilterOperations RenderSurfaceFilters::Optimize(
313 const WebKit::WebFilterOperations& filters) { 313 const WebKit::WebFilterOperations& filters) {
314 WebKit::WebFilterOperations new_list; 314 WebKit::WebFilterOperations new_list;
315 315
316 SkScalar accumulated_color_matrix[20]; 316 SkScalar accumulated_color_matrix[20];
317 bool have_accumulated_color_matrix = false; 317 bool have_accumulated_color_matrix = false;
318 for (unsigned i = 0; i < filters.size(); ++i) { 318 for (unsigned i = 0; i < filters.size(); ++i) {
319 const WebKit::WebFilterOperation& op = filters.at(i); 319 const WebKit::WebFilterOperation& op = filters.at(i);
320 320
321 // If the filter is a color matrix, we may be able to combine it with 321 // If the filter is a color matrix, we may be able to combine it with
322 // following filter(s) that also are color matrices. 322 // following Filter(s) that also are color matrices.
323 SkScalar matrix[20]; 323 SkScalar matrix[20];
324 if (GetColorMatrix(op, matrix)) { 324 if (GetColorMatrix(op, matrix)) {
325 if (have_accumulated_color_matrix) { 325 if (have_accumulated_color_matrix) {
326 SkScalar newMatrix[20]; 326 SkScalar newMatrix[20];
327 MultColorMatrix(matrix, accumulated_color_matrix, newMatrix); 327 MultColorMatrix(matrix, accumulated_color_matrix, newMatrix);
328 memcpy(accumulated_color_matrix, 328 memcpy(accumulated_color_matrix,
329 newMatrix, 329 newMatrix,
330 sizeof(accumulated_color_matrix)); 330 sizeof(accumulated_color_matrix));
331 } else { 331 } else {
332 memcpy(accumulated_color_matrix, 332 memcpy(accumulated_color_matrix,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 case WebKit::WebFilterOperation::FilterTypeOpacity: 449 case WebKit::WebFilterOperation::FilterTypeOpacity:
450 NOTREACHED(); 450 NOTREACHED();
451 break; 451 break;
452 } 452 }
453 state.Swap(); 453 state.Swap();
454 } 454 }
455 return state.Source(); 455 return state.Source();
456 } 456 }
457 457
458 } // namespace cc 458 } // namespace cc
OLDNEW
« no previous file with comments | « cc/render_surface.cc ('k') | cc/render_surface_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698