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

Side by Side Diff: core/cross/gl/renderer_gl.cc

Issue 6538102: Add support for runtime fall-back from o3d to o2d. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 9 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2009, Google Inc. 2 * Copyright 2009, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 } 1518 }
1519 1519
1520 const int* RendererGL::GetRGBAUByteNSwizzleTable() { 1520 const int* RendererGL::GetRGBAUByteNSwizzleTable() {
1521 static int swizzle_table[] = { 0, 1, 2, 3, }; 1521 static int swizzle_table[] = { 0, 1, 2, 3, };
1522 return swizzle_table; 1522 return swizzle_table;
1523 } 1523 }
1524 1524
1525 // This is a factory function for creating Renderer objects. Since 1525 // This is a factory function for creating Renderer objects. Since
1526 // we're implementing GL, we only ever return a GL renderer. 1526 // we're implementing GL, we only ever return a GL renderer.
1527 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) { 1527 Renderer* Renderer::CreateDefaultRenderer(ServiceLocator* service_locator) {
1528 #ifdef FORCE_CAIRO
1529 return o2d::RendererCairo::CreateDefault(service_locator);
1530 #else
1531 return RendererGL::CreateDefault(service_locator); 1528 return RendererGL::CreateDefault(service_locator);
1532 #endif
1533 } 1529 }
1534 1530
1535 #ifdef OS_MACOSX 1531 #ifdef OS_MACOSX
1536 void RendererGL::set_mac_cgl_context(CGLContextObj obj) { 1532 void RendererGL::set_mac_cgl_context(CGLContextObj obj) {
1537 bool changed = (mac_cgl_context_ != obj); 1533 bool changed = (mac_cgl_context_ != obj);
1538 mac_cgl_context_ = obj; 1534 mac_cgl_context_ = obj;
1539 if (changed) { 1535 if (changed) {
1540 // We need to reset all of the OpenGL state when the context changes. 1536 // We need to reset all of the OpenGL state when the context changes.
1541 alpha_function_ref_changed_ = true; 1537 alpha_function_ref_changed_ = true;
1542 alpha_blend_settings_changed_ = true; 1538 alpha_blend_settings_changed_ = true;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1590
1595 if (must_reset_context_) { 1591 if (must_reset_context_) {
1596 // Apply the initial rendering states to the newly set context. 1592 // Apply the initial rendering states to the newly set context.
1597 SetInitialStates(); 1593 SetInitialStates();
1598 } 1594 }
1599 1595
1600 must_reset_context_ = false; 1596 must_reset_context_ = false;
1601 } 1597 }
1602 1598
1603 } // namespace o3d 1599 } // namespace o3d
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698